UrlAlterFunctionalTest::assertUrlOutboundAlter

7 path.test protected UrlAlterFunctionalTest::assertUrlOutboundAlter($original, $final)
8 path.test protected UrlAlterFunctionalTest::assertUrlOutboundAlter($original, $final)

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

Parameters

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

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

Return value

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

File

modules/simpletest/tests/path.test, line 221
Tests for path.inc.

Code

protected function assertUrlOutboundAlter($original, $final) {
  // Test outbound altering.
  $result = url($original);
  $base_path = base_path() . (variable_get('clean_url', '0') ? '' : '?q=');
  $result = substr($result, strlen($base_path));
  $this->assertIdentical($result, $final, t('Altered outbound URL %original, expected %final, and got %result.', array('%original' => $original, '%final' => $final, '%result' => $result)));
}
Login or register to post comments