function DisplayPathTest::doBasicPathUITest

Same name in other branches
  1. 8.9.x core/modules/views_ui/tests/src/Functional/DisplayPathTest.php \Drupal\Tests\views_ui\Functional\DisplayPathTest::doBasicPathUITest()
  2. 10 core/modules/views_ui/tests/src/Functional/DisplayPathTest.php \Drupal\Tests\views_ui\Functional\DisplayPathTest::doBasicPathUITest()
  3. 11.x core/modules/views_ui/tests/src/Functional/DisplayPathTest.php \Drupal\Tests\views_ui\Functional\DisplayPathTest::doBasicPathUITest()

Tests basic functionality in configuring a view.

1 call to DisplayPathTest::doBasicPathUITest()
DisplayPathTest::testPathUI in core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
Runs the tests.

File

core/modules/views_ui/tests/src/Functional/DisplayPathTest.php, line 52

Class

DisplayPathTest
Tests the UI of generic display path plugin.

Namespace

Drupal\Tests\views_ui\Functional

Code

protected function doBasicPathUITest() {
    $this->drupalGet('admin/structure/views/view/test_view');
    // Add a new page display and check the appearing text.
    $this->submitForm([], 'Add Page');
    $this->assertSession()
        ->pageTextContains('No path is set');
    $this->assertSession()
        ->linkNotExists('View page', 'No view page link found on the page.');
    // Save a path and make sure the summary appears as expected.
    $random_path = $this->randomMachineName();
    // @todo Once https://www.drupal.org/node/2351379 is resolved, Views will no
    //   longer use Url::fromUri(), and this path will be able to contain ':'.
    $random_path = str_replace(':', '', $random_path);
    $this->drupalGet('admin/structure/views/nojs/display/test_view/page_1/path');
    $this->submitForm([
        'path' => $random_path,
    ], 'Apply');
    $this->assertSession()
        ->pageTextContains('/' . $random_path);
    $this->clickLink('View Page');
    $this->assertSession()
        ->addressEquals($random_path);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.