protected function UrlAlterFunctionalTest::assertUrlInboundAlter

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

Parameters

$original: A string with the aliased or un-normal path that is run through drupal_container()->get('path.alias_manager')->getSystemPath().

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

Return value

TRUE if $original was correctly altered to $final, FALSE otherwise.

1 call to UrlAlterFunctionalTest::assertUrlInboundAlter()
UrlAlterFunctionalTest::testUrlAlter in drupal/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php
Test that URL altering works and that it occurs in the correct order.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php, line 121
Definition of Drupal\system\Tests\Path\UrlAlterFunctionalTest.

Class

UrlAlterFunctionalTest
Tests hook_url_alter functions.

Namespace

Drupal\system\Tests\Path

Code

protected function assertUrlInboundAlter($original, $final) {

  // Test inbound altering.
  $result = drupal_container()
    ->get('path.alias_manager')
    ->getSystemPath($original);
  $this
    ->assertIdentical($result, $final, format_string('Altered inbound URL %original, expected %final, and got %result.', array(
    '%original' => $original,
    '%final' => $final,
    '%result' => $result,
  )));
}