You are here

function SubPathautoUnitTestCase::assertAlias in Sub-pathauto (Sub-path URL Aliases) 7

2 calls to SubPathautoUnitTestCase::assertAlias()
SubPathautoUnitTestCase::assertNoAlias in ./subpathauto.test
SubPathautoUnitTestCase::testSubPathAliases in ./subpathauto.test

File

./subpathauto.test, line 113
Test integration for the subpathauto.module.

Class

SubPathautoUnitTestCase
@file Test integration for the subpathauto.module.

Code

function assertAlias($source, $alias, array $options = array()) {
  $actual_alias = $this
    ->getPathAlias($source, $options);
  $actual_source = drupal_get_normal_path($alias);
  $args = array(
    '@source' => $source,
    '@alias' => $alias,
    '@source-actual' => $actual_source,
    '@alias-actual' => $actual_alias,
  );
  return $this
    ->assertIdentical($alias, $actual_alias, t("drupal_get_path_alias('@source') was '@alias-actual' and expected '@alias'", $args)) || $this
    ->assertIdentical($source, $actual_source, t("drupal_get_normal_path('@alias') was '@source-actual' and expected '@source'", $args));
}