Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
validateRecipientData example
static
::
assertInstanceOf
(
StorefrontResponse::
class
,
$response
)
;
static
::
assertSame
(
200,
$response
->
getStatusCode
(
)
)
;
$repo
=
$this
->
getContainer
(
)
->
get
(
'newsletter_recipient.repository'
)
;
$criteria
=
new
Criteria
(
)
;
$criteria
->
addFilter
(
new
EqualsFilter
(
'email', '
[email protected]
'
)
)
;
/** @var NewsletterRecipientEntity $recipientEntry */
$recipientEntry
=
$repo
->
search
(
$criteria
, Context::
createDefaultContext
(
)
)
->
first
(
)
;
static
::
assertEquals
(
'direct',
(string)
$recipientEntry
->
getStatus
(
)
)
;
$this
->
validateRecipientData
(
$recipientEntry
)
;
}
public
function
testRegisterNewsletterForCustomerDoi
(
)
: void
{
$systemConfigService
=
$this
->
getContainer
(
)
->
get
(
SystemConfigService::
class
)
;
static
::
assertNotNull
(
$systemConfigService
)
;
$systemConfigService
->
set
(
'core.newsletter.doubleOptInRegistered', true
)
;
$browser
=
$this
->
login
(
)
;
$data
=
[
'option' => 'subscribe',
]
;