function UrlAlterFunctionalTest::assertUrlInboundAlter
Same name in other branches
- 7.x modules/simpletest/tests/path.test \UrlAlterFunctionalTest::assertUrlInboundAlter()
- 9 core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php \Drupal\Tests\path_alias\Functional\UrlAlterFunctionalTest::assertUrlInboundAlter()
- 10 core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php \Drupal\Tests\path_alias\Functional\UrlAlterFunctionalTest::assertUrlInboundAlter()
- 10 core/modules/forum/tests/src/Functional/UrlAlterFunctionalTest.php \Drupal\Tests\forum\Functional\UrlAlterFunctionalTest::assertUrlInboundAlter()
- 11.x core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php \Drupal\Tests\path_alias\Functional\UrlAlterFunctionalTest::assertUrlInboundAlter()
- 11.x core/modules/forum/tests/src/Functional/UrlAlterFunctionalTest.php \Drupal\Tests\forum\Functional\UrlAlterFunctionalTest::assertUrlInboundAlter()
Assert that a inbound path is altered to an expected value.
Parameters
$original: The original path before it has been altered by inbound URL processing.
$final: A string with the expected result.
Return value
TRUE if $original was correctly altered to $final, FALSE otherwise.
1 call to UrlAlterFunctionalTest::assertUrlInboundAlter()
- UrlAlterFunctionalTest::testUrlAlter in core/
modules/ path_alias/ tests/ src/ Functional/ UrlAlterFunctionalTest.php - Test that URL altering works and that it occurs in the correct order.
File
-
core/
modules/ path_alias/ tests/ src/ Functional/ UrlAlterFunctionalTest.php, line 120
Class
- UrlAlterFunctionalTest
- Tests altering the inbound path and the outbound path.
Namespace
Drupal\Tests\path_alias\FunctionalCode
protected function assertUrlInboundAlter($original, $final) {
// Test inbound altering.
$result = $this->container
->get('path_alias.manager')
->getPathByAlias($original);
return $this->assertIdentical($result, $final, new FormattableMarkup('Altered inbound URL %original, expected %final, and got %result.', [
'%original' => $original,
'%final' => $final,
'%result' => $result,
]));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.