You are here

public function ViewEventTest::testPreBuildEvent in Hook Event Dispatcher 8

Pre build event.

File

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

Class

ViewEventTest
Class ViewEventTest.

Namespace

Drupal\Tests\hook_event_dispatcher\Unit\Views

Code

public function testPreBuildEvent() {

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

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