function DisplayPathTest::doAdvancedPathsValidationTest

Same name in other branches
  1. 9 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 101

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->drupalPostForm($url, [
        'path' => '%/magrathea',
    ], t('Apply'));
    $this->assertUrl($url);
    $this->assertText('"%" may not be used for the first segment of a path.');
    $this->drupalPostForm($url, [
        'path' => 'user/%1/example',
    ], t('Apply'));
    $this->assertUrl($url);
    $this->assertText("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.