public function TokenEventTest::testTokenReplacementEventInvalidReplacementException in Hook Event Dispatcher 8
Test TokenReplacementEvent invalid replacement Exception.
File
- tests/
src/ Unit/ Token/ TokenEventTest.php, line 202
Class
- TokenEventTest
- Class TokenEventTest.
Namespace
Drupal\Tests\hook_event_dispatcher\Unit\TokenCode
public function testTokenReplacementEventInvalidReplacementException() {
$metaData = $this
->createMock(BubbleableMetadata::class);
$event = new TokensReplacementEvent('test', [
'token' => '[test:token]',
], [], [], $metaData);
$this
->setExpectedException(\UnexpectedValueException::class);
$event
->setReplacementValue('test', 'token', NULL);
}