You are here

public function OtherEventVariablesTest::testPageEvent in Hook Event Dispatcher 3.x

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

Test a PagePreprocessEvent.

File

modules/preprocess_event_dispatcher/tests/src/Unit/OtherEventVariablesTest.php, line 158

Class

OtherEventVariablesTest
Class OtherEventVariablesTest.

Namespace

Drupal\Tests\preprocess_event_dispatcher\Unit

Code

public function testPageEvent() : void {
  $variablesArray = [
    'page' => $this
      ->createVariablesArray(),
  ];

  /** @var \Drupal\preprocess_event_dispatcher\Variables\PageEventVariables $variables */
  $variables = $this
    ->getVariablesFromCreatedEvent(PagePreprocessEvent::class, $variablesArray);
  self::assertInstanceOf(PageEventVariables::class, $variables);
  $this
    ->assertAbstractEventVariables($variables);
}