You are here

protected function UrlAlterFunctionalTest::assertUrlInboundAlter in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php \Drupal\Tests\path_alias\Functional\UrlAlterFunctionalTest::assertUrlInboundAlter()
  2. 10 core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php \Drupal\Tests\path_alias\Functional\UrlAlterFunctionalTest::assertUrlInboundAlter()

Assert that an 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.

1 call to UrlAlterFunctionalTest::assertUrlInboundAlter()
UrlAlterFunctionalTest::testUrlAlter in core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php
Tests that URL altering works and that it occurs in the correct order.

File

core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php, line 115

Class

UrlAlterFunctionalTest
Tests altering the inbound path and the outbound path.

Namespace

Drupal\Tests\path_alias\Functional

Code

protected function assertUrlInboundAlter($original, $final) {

  // Test inbound altering.
  $result = $this->container
    ->get('path_alias.manager')
    ->getPathByAlias($original);
  $this
    ->assertSame($final, $result, new FormattableMarkup('Altered inbound URL %original, expected %final, and got %result.', [
    '%original' => $original,
    '%final' => $final,
    '%result' => $result,
  ]));
}