public function PreprocessModuleTest::testPreprocessHook in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 modules/preprocess_event_dispatcher/tests/src/Unit/PreprocessModuleTest.php \Drupal\Tests\preprocess_event_dispatcher\Unit\PreprocessModuleTest::testPreprocessHook()
Preprocess hook test.
File
- modules/
preprocess_event_dispatcher/ tests/ src/ Unit/ PreprocessModuleTest.php, line 39
Class
- PreprocessModuleTest
- Class PreprocessModuleTest.
Namespace
Drupal\Tests\preprocess_event_dispatcher\UnitCode
public function testPreprocessHook() : void {
$hook = $expectedHook = 'test';
$variables = [
'some' => 'variables',
];
$this->service
->expects('createAndDispatchKnownEvents')
->once()
->with($hook, $variables);
preprocess_event_dispatcher_preprocess($variables, $hook);
// Just test something so PHPUnit does not complain about no assertions,
// while Mockery asserts the service being called.
self::assertSame($expectedHook, $hook);
}