You are here

protected function UrlAlterFunctionalTest::assertUrlOutboundAlter in Drupal 10

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

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

@internal

Parameters

string $original: A string with the original path that is run through generateFrommPath().

string $final: A string with the expected result after generateFrommPath().

File

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

Class

UrlAlterFunctionalTest
Tests altering the inbound path and the outbound path.

Namespace

Drupal\Tests\path_alias\Functional

Code

protected function assertUrlOutboundAlter(string $original, string $final) : void {

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