You are here

protected function DisplayPathTest::doAdvancedPathsValidationTest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views_ui/src/Tests/DisplayPathTest.php \Drupal\views_ui\Tests\DisplayPathTest::doAdvancedPathsValidationTest()

Tests a couple of invalid path patterns.

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

File

core/modules/views_ui/src/Tests/DisplayPathTest.php, line 97
Contains \Drupal\views_ui\Tests\DisplayPathTest.

Class

DisplayPathTest
Tests the UI of generic display path plugin.

Namespace

Drupal\views_ui\Tests

Code

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