You are here

public function DisplayVariantOverrideTest::testDisabledRouteOverrideForNodeViewCausesNodeToBeRenderedNormally in Panels Everywhere 8.4

Verify that disabling route overrides work.

File

tests/src/Functional/DisplayVariantOverrideTest.php, line 146

Class

DisplayVariantOverrideTest
Make sure the route override behaviour works as intended.

Namespace

Drupal\Tests\panels_everywhere\Functional

Code

public function testDisabledRouteOverrideForNodeViewCausesNodeToBeRenderedNormally() {
  $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' => FALSE,
    ],
  ]);
  $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()
    ->pageTextContains($this->node->body->value);
}