You are here

public function ViewEventTest::testPreRender in Hook Event Dispatcher 8

Pre render event.

File

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

Class

ViewEventTest
Class ViewEventTest.

Namespace

Drupal\Tests\hook_event_dispatcher\Unit\Views

Code

public function testPreRender() {

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

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