function PanelsEverywhereBasicsTestCase::testDefaultDisplay in Panels Everywhere 7
Confirm the default display loads the correct panes.
File
- tests/
PanelsEverywhereBasicsTestCase.test, line 43 - Basic tests for the Panels Everywhere module.
Class
- PanelsEverywhereBasicsTestCase
- @file Basic tests for the Panels Everywhere module.
Code
function testDefaultDisplay() {
// Enable PE for use on Bartik.
$this
->enableBartik();
// Load the front page.
$this
->drupalGet('<front>');
$this
->assertResponse(200);
// Confirm the page is using Panels Everywhere.
$this
->assertRaw('<div class="panel-flexible panels-flexible-new clearfix" id="page-wrapper">');
// Confirm each of the default panes is present. Note: the 'user' pane will
// not be visible as it's only shown to anonymous visitors.
$panes = array(
'pane-pane-header',
'pane-page-content',
'pane-block pane-search-form',
'pane-pane-navigation',
);
foreach ($panes as $pane) {
$xpath = $this
->xpath("//div[@class='panel-pane {$pane}']");
$this
->assertEqual(count($xpath), 1, "Found the {$pane} pane.");
}
// Log out and confirm the 'user' pane exists.
$this
->drupalLogout();
// Load the front page again.
$this
->drupalGet('<front>');
$this
->assertResponse(200);
// Confirm the 'user' form is now present.
$panes = array(
'pane-user-login',
);
foreach ($panes as $pane) {
$xpath = $this
->xpath("//div[@class='panel-pane pane-block {$pane}']");
$this
->assertEqual(count($xpath), 1, "Found the {$pane} pane.");
}
}