class NewsletterRecipientServiceTest extends TestCase
{ use IntegrationTestBehaviour;
/**
* @dataProvider dataProvider_testSubscribeNewsletterExpectsConstraintViolationException
*
* @param array<int, array<int, array<string, string|null>>> $testData
*/
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
);
}