public function PanelizerIntegrationTest::testUserEditSession in Panelizer 8.4
Same name and namespace in other branches
- 8.5 tests/src/FunctionalJavascript/PanelizerIntegrationTest.php \Drupal\Tests\panelizer\FunctionalJavascript\PanelizerIntegrationTest::testUserEditSession()
Tests that the IPE editing session is specific to a user.
File
- tests/
src/ FunctionalJavascript/ PanelizerIntegrationTest.php, line 82
Class
- PanelizerIntegrationTest
- Tests the JavaScript functionality of Panels IPE with Panelizer.
Namespace
Drupal\Tests\panelizer\FunctionalJavascriptCode
public function testUserEditSession() {
$this
->visitIPERoute();
$this
->assertSession()
->elementExists('css', '.layout--onecol');
// Change the layout to lock the IPE.
$this
->changeLayout('Columns: 2', 'layout_twocol');
$this
->assertSession()
->elementExists('css', '.layout--twocol');
$this
->assertSession()
->elementNotExists('css', '.layout--onecol');
// Create a second node.
$this
->drupalGet('node/add/page');
$this
->submitForm([
'title[0][value]' => 'Test Node 2',
], t('Save'));
$this->test_route = 'node/2';
// Ensure the second node does not use the session of the other node.
$this
->visitIPERoute();
$this
->assertSession()
->elementExists('css', '.layout--onecol');
$this
->assertSession()
->elementNotExists('css', '.layout--twocol');
}