function PathMatcherTest::testMatchPath
Same name and namespace in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php \Drupal\Tests\Core\Path\PathMatcherTest::testMatchPath()
- 10 core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php \Drupal\Tests\Core\Path\PathMatcherTest::testMatchPath()
- 11.x core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php \Drupal\Tests\Core\Path\PathMatcherTest::testMatchPath()
Tests that standard paths works with multiple patterns.
@dataProvider getMatchPathData
File
-
core/
tests/ Drupal/ Tests/ Core/ Path/ PathMatcherTest.php, line 43
Class
- PathMatcherTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Path%21PathMatcher.php/class/PathMatcher/9" title="Provides a path matcher." class="local">\Drupal\Core\Path\PathMatcher</a> @group Path
Namespace
Drupal\Tests\Core\PathCode
public function testMatchPath($patterns, $paths) {
foreach ($paths as $path => $expected_result) {
$actual_result = $this->pathMatcher
->matchPath($path, $patterns);
$this->assertEquals($actual_result, $expected_result, "Tried matching the path '{$path}' to the pattern '{$patterns}'.");
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.