function UrlAlterFunctionalTest::assertUrlInboundAlter

Same name in this branch
  1. 11.x core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php \Drupal\Tests\path_alias\Functional\UrlAlterFunctionalTest::assertUrlInboundAlter()
Same name in other branches
  1. 7.x modules/simpletest/tests/path.test \UrlAlterFunctionalTest::assertUrlInboundAlter()
  2. 9 core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php \Drupal\Tests\path_alias\Functional\UrlAlterFunctionalTest::assertUrlInboundAlter()
  3. 8.9.x core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php \Drupal\Tests\path_alias\Functional\UrlAlterFunctionalTest::assertUrlInboundAlter()
  4. 10 core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php \Drupal\Tests\path_alias\Functional\UrlAlterFunctionalTest::assertUrlInboundAlter()
  5. 10 core/modules/forum/tests/src/Functional/UrlAlterFunctionalTest.php \Drupal\Tests\forum\Functional\UrlAlterFunctionalTest::assertUrlInboundAlter()

Assert that an inbound path is altered to an expected value.

@internal

Parameters

string $original: The original path before it has been altered by inbound URL processing.

string $final: A string with the expected result.

File

core/modules/forum/tests/src/Functional/UrlAlterFunctionalTest.php, line 81

Class

UrlAlterFunctionalTest
Tests altering the inbound path and the outbound path.

Namespace

Drupal\Tests\forum\Functional

Code

protected function assertUrlInboundAlter(string $original, string $final) : void {
    // Test inbound altering.
    $result = $this->container
        ->get('path_alias.manager')
        ->getPathByAlias($original);
    $this->assertSame($final, $result, "Altered inbound URL {$original}, expected {$final}, and got {$result}.");
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.