CmsPageDefaultChangeSubscriber example



    /** * @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) {
                
Home | Imprint | This part of the site doesn't use cookies.