You are here

public function EntityEventTest::testNodeEvent in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/preprocess_event_dispatcher/tests/src/Unit/EntityEventTest.php \Drupal\Tests\preprocess_event_dispatcher\Unit\EntityEventTest::testNodeEvent()

Test a NodePreprocessEvent.

File

modules/preprocess_event_dispatcher/tests/src/Unit/EntityEventTest.php, line 88

Class

EntityEventTest
Class EntityEventTest.

Namespace

Drupal\Tests\preprocess_event_dispatcher\Unit

Code

public function testNodeEvent() : void {
  $variables = [
    'node' => EntityMockFactory::getMock(NodeInterface::class, 'node', 'bundle', 'view_mode'),
    'theme_hook_original' => 'node',
    'view_mode' => 'view_mode',
  ];
  $this
    ->createAndAssertEntityEvent(NodePreprocessEvent::class, $variables);
}