You are here

protected function DisplayPathTest::doAdvancedPathsValidationTest in Drupal 9

Same name and namespace in other branches
  1. 8 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 99

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 (%).");
}