/**
* @param list<string> $event
* @param array<mixed> $connectionData
*
* @dataProvider beforeDeletionEventDataProvider
*/
public function testBeforeDeletionEvent(array
$event, array
$connectionData, ?string
$expectedExceptionCode = null
): void
{ $connection =
$this->
getConnectionMock($connectionData);
$cmsPageDefaultChangeSubscriber =
new CmsPageDefaultChangeSubscriber($connection);
$exceptionWasThrown = false;
try { $cmsPageDefaultChangeSubscriber->
beforeDeletion($this->
getBeforeDeleteEvent($event));
} catch (CmsException
$exception) { if ($expectedExceptionCode) { static::
assertEquals($expectedExceptionCode,
$exception->
getErrorCode());
$exceptionWasThrown = true;
} } finally { if ($expectedExceptionCode && !
$exceptionWasThrown) {