public function testSubscribeNewsletterExpectsConstraintViolationException(array
$testData): void
{ $this->
installTestData();
$dataBag =
new RequestDataBag($testData);
self::
expectException(ConstraintViolationException::
class);
$salesChannelContextFactory =
$this->
getContainer()->
get(SalesChannelContextFactory::
class);
$context =
$salesChannelContextFactory->
create(Uuid::
randomHex(), TestDefaults::SALES_CHANNEL
);
$this->
getContainer()->
get(NewsletterSubscribeRoute::
class) ->
subscribe($dataBag,
$context, false
);
} /**
* @return array<int, array<int, array<string, string|null>>>
*/
public static function dataProvider_testSubscribeNewsletterExpectsConstraintViolationException(): array
{ $testData1 =
['email' => null, 'salutationId' => null, 'option' => null
];
$testData2 =
['email' => '', 'salutationId' => null, 'option' => null
];
$testData3 =
['email' => '', 'salutationId' => '', 'option' => null
];
$testData4 =
['email' => '', 'salutationId' => '', 'option' => null
];