You are here

public function PageTest::testIsNodePage in Hook Event Dispatcher 3.x

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

Test is node page.

File

modules/preprocess_event_dispatcher/tests/src/Unit/PageTest.php, line 66

Class

PageTest
Class PageTest.

Namespace

Drupal\Tests\preprocess_event_dispatcher\Unit

Code

public function testIsNodePage() : void {
  $vars = [];
  $page = new PageEventVariables($vars);
  self::assertFalse($page
    ->isNodePage());
  $vars['node'] = new stdClass();
  self::assertFalse($page
    ->isNodePage());
  $vars['node'] = Mockery::mock(NodeInterface::class);
  self::assertTrue($page
    ->isNodePage());
}