You are here

public function ViewEventTest::testPreExecuteEvent in Hook Event Dispatcher 8

Pre execute event.

File

tests/src/Unit/Views/ViewEventTest.php, line 97

Class

ViewEventTest
Class ViewEventTest.

Namespace

Drupal\Tests\hook_event_dispatcher\Unit\Views

Code

public function testPreExecuteEvent() {

  /** @var \Drupal\views\ViewExecutable $view */
  $view = $this
    ->createMock(ViewExecutable::class);
  hook_event_dispatcher_views_pre_execute($view);

  /** @var \Drupal\hook_event_dispatcher\Event\Views\ViewsPreBuildEvent $event */
  $event = $this->manager
    ->getRegisteredEvent(HookEventDispatcherInterface::VIEWS_PRE_EXECUTE);
  self::assertEquals($view, $event
    ->getView());
}