You are here

protected function PageManagerAdminTest::doTestAddPageWithDuplicatePath in Page Manager 8

Tests adding a page with a duplicate path.

1 call to PageManagerAdminTest::doTestAddPageWithDuplicatePath()
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 443
Contains \Drupal\page_manager_ui\Tests\PageManagerAdminTest.

Class

PageManagerAdminTest
Tests the admin UI for page entities.

Namespace

Drupal\page_manager_ui\Tests

Code

protected function doTestAddPageWithDuplicatePath() {

  // Try to add a second page with the same path.
  $edit = [
    'label' => 'Bar',
    'id' => 'bar',
    'path' => 'admin/foo',
  ];
  $this
    ->drupalPostForm('admin/structure/page_manager/add', $edit, 'Next');
  $this
    ->assertText('The page path must be unique.');
  $this
    ->drupalGet('admin/structure/page_manager');
  $this
    ->assertNoText('Bar');
}