You are here

public function PageTest::testIsNodePage in Hook Event Dispatcher 8

Test is node page.

File

tests/src/Unit/Preprocess/PageTest.php, line 81

Class

PageTest
Class PageTest.

Namespace

Drupal\Tests\hook_event_dispatcher\Unit\Preprocess

Code

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