public function DisplayVariantOverrideTest::testEnabledRouteOverrideForNodeViewWithoutOtherVariantPresentWillCausesNodeToNotBeRendered in Panels Everywhere 8.4
Verify that enabling route overrides work.
File
- tests/
src/ Functional/ DisplayVariantOverrideTest.php, line 176
Class
- DisplayVariantOverrideTest
- Make sure the route override behaviour works as intended.
Namespace
Drupal\Tests\panels_everywhere\FunctionalCode
public function testEnabledRouteOverrideForNodeViewWithoutOtherVariantPresentWillCausesNodeToNotBeRendered() {
$page = $this->pageStorage
->load('node_view');
$customVariant = $this->pageVariantStorage
->create([
'id' => 'this-is-a-custom-variant',
'variant' => 'panels_everywhere_variant',
'variant_settings' => [
'id' => 'panels_everywhere_variant',
'layout' => 'layout_onecol',
'builder' => 'standard',
'route_override_enabled' => TRUE,
],
]);
$customVariant
->setPageEntity($page);
$this
->placeBlockOnVariant($customVariant, 'system_main_block', 'content');
$this
->placeBlockOnVariant($customVariant, 'system_powered_by_block', 'content');
$customVariant
->save();
// @todo: Remove once cache info is setup correctly
drupal_flush_all_caches();
$this
->drupalGet('node/' . $this->node
->id());
$this
->assertSession()
->pageTextContains('Powered by');
$this
->assertSession()
->pageTextNotContains($this->node->body->value);
}