You are here

public function PathEncodedTest::testGetEncoded in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/FunctionalTests/Routing/PathEncodedTest.php \Drupal\FunctionalTests\Routing\PathEncodedTest::testGetEncoded()
  2. 9 core/tests/Drupal/FunctionalTests/Routing/PathEncodedTest.php \Drupal\FunctionalTests\Routing\PathEncodedTest::testGetEncoded()

File

core/tests/Drupal/FunctionalTests/Routing/PathEncodedTest.php, line 29

Class

PathEncodedTest
Tests url generation and routing for route paths with encoded characters.

Namespace

Drupal\FunctionalTests\Routing

Code

public function testGetEncoded() {
  $route_paths = [
    'path_encoded_test.colon' => '/hi/llamma:party',
    'path_encoded_test.atsign' => '/bloggy/@Dries',
    'path_encoded_test.parens' => '/cat(box)',
  ];
  foreach ($route_paths as $route_name => $path) {
    $this
      ->drupalGet(Url::fromRoute($route_name));
    $this
      ->assertSession()
      ->pageTextContains('PathEncodedTestController works');
  }
}