You are here

public function PanelsEverywhereTest::testSiteTemplate in Panels Everywhere 8.4

Verify that enabling and disabling site_template.

File

tests/src/Functional/PanelsEverywhereTest.php, line 55

Class

PanelsEverywhereTest
Make sure that PE can be enabled.

Namespace

Drupal\Tests\panels_everywhere\Functional

Code

public function testSiteTemplate() {
  $pageText = 'No front page content has been created yet.';
  $siteTemplate = $this
    ->loadSiteTemplate();
  $this
    ->assertEquals(FALSE, $siteTemplate
    ->status(), 'Expect the site_template to be disabled by default');
  $this
    ->checkFrontPageWorks();
  $this
    ->assertSession()
    ->pageTextContains($pageText);
  $this
    ->enableSiteTemplate();
  $this
    ->checkFrontPageWorks();
  $this
    ->assertSession()
    ->pageTextNotContains($pageText);
  $this
    ->loadSiteTemplate()
    ->setStatus(FALSE)
    ->save();

  // @todo: Remove once cache info is setup correctly
  drupal_flush_all_caches();
  $this
    ->checkFrontPageWorks();
  $this
    ->assertSession()
    ->pageTextContains($pageText);
}