protected function PageManagerAdminTest::doTestSecondPage in Page Manager 8
Creates a second page with another block display.
1 call to PageManagerAdminTest::doTestSecondPage()
- PageManagerAdminTest::testAdmin in page_manager_ui/
src/ Tests/ PageManagerAdminTest.php - Tests the Page Manager admin UI.
File
- page_manager_ui/
src/ Tests/ PageManagerAdminTest.php, line 340 - Contains \Drupal\page_manager_ui\Tests\PageManagerAdminTest.
Class
- PageManagerAdminTest
- Tests the admin UI for page entities.
Namespace
Drupal\page_manager_ui\TestsCode
protected function doTestSecondPage() {
$this
->drupalGet('admin/structure/page_manager');
// Add a new page.
$this
->clickLink('Add page');
$edit = [
'id' => 'second',
'label' => 'Second',
'path' => 'second',
'variant_plugin_id' => 'block_display',
];
$this
->drupalPostForm(NULL, $edit, 'Next');
// Configure the variant.
$edit = [
'page_variant_label' => 'Second variant',
'variant_settings[page_title]' => 'Second title',
];
$this
->drupalPostForm(NULL, $edit, 'Next');
// We're now on the content step, but we don't need to add any blocks.
$this
->drupalPostForm(NULL, [], 'Finish');
$this
->assertRaw(new FormattableMarkup('Saved the %label Page.', [
'%label' => 'Second',
]));
// Visit both pages, make sure that they do not interfere with each other.
$this
->drupalGet('admin/foo');
$this
->assertTitle('Example title | Drupal');
$this
->drupalGet('second');
$this
->assertTitle('Second title | Drupal');
}