function DisplayPathTest::doAdvancedPathsValidationTest

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

Tests a couple of invalid path patterns.

1 call to DisplayPathTest::doAdvancedPathsValidationTest()
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 102

Class

DisplayPathTest
Tests the UI of generic display path plugin.

Namespace

Drupal\Tests\views_ui\Functional

Code

protected function doAdvancedPathsValidationTest() {
    $url = 'admin/structure/views/nojs/display/test_view/page_1/path';
    $this->drupalGet($url);
    $this->submitForm([
        'path' => '%/magrathea',
    ], 'Apply');
    $this->assertSession()
        ->addressEquals($url);
    $this->assertSession()
        ->pageTextContains('"%" may not be used for the first segment of a path.');
    $this->drupalGet($url);
    $this->submitForm([
        'path' => 'user/%1/example',
    ], 'Apply');
    $this->assertSession()
        ->addressEquals($url);
    $this->assertSession()
        ->pageTextContains("Numeric placeholders may not be used. Please use plain placeholders (%).");
}

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