You are here

public function PanelsEverywhereTest::testOtherPages in Panels Everywhere 8.4

Verify that other pages load before and after enabling site_template.

File

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

Class

PanelsEverywhereTest
Make sure that PE can be enabled.

Namespace

Drupal\Tests\panels_everywhere\Functional

Code

public function testOtherPages() {

  // Check that 404 pages loads properly by default.
  $this
    ->drupalGet('/some/page/that/should/not/exist');
  $this
    ->assertSession()
    ->statusCodeEquals(404);

  // Check that the login page load properly by default.
  $this
    ->drupalGet('/user/login');
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Enable site template & clear page-cache.
  $this
    ->loadSiteTemplate()
    ->setStatus(TRUE)
    ->save();
  drupal_flush_all_caches();

  // Check that 404 pages loads properly.
  $this
    ->drupalGet('/some/page/that/should/not/exist');
  $this
    ->assertSession()
    ->statusCodeEquals(404);

  // Check that the login page load properly.
  $this
    ->drupalGet('/user/login');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
}