You are here

public function ViewEventTest::testPreExecuteEvent in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/views_event_dispatcher/tests/src/Unit/Views/ViewEventTest.php \Drupal\Tests\views_event_dispatcher\Unit\Views\ViewEventTest::testPreExecuteEvent()

Pre execute event.

File

modules/views_event_dispatcher/tests/src/Unit/Views/ViewEventTest.php, line 108

Class

ViewEventTest
Class ViewEventTest.

Namespace

Drupal\Tests\views_event_dispatcher\Unit\Views

Code

public function testPreExecuteEvent() : void {

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

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