public function PageTest::testIsNodePage in Hook Event Dispatcher 8.2
Same name and namespace in other branches
- 3.x 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\UnitCode
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());
}