You are here

public function SubPathautoTest::pathAliasCallback in Sub-pathauto (Sub-path URL Aliases) 8

Return value callback for getPathByAlias() method on the alias manager.

Ensures that by default the call to getPathAlias() will return the first argument that was passed in. We special-case the paths for which we wish it to return an actual alias.

Parameters

string $path: The path.

Return value

string The path represented by the alias, or the alias if no path was found.

File

tests/src/Unit/SubPathautoTest.php, line 256

Class

SubPathautoTest
@coversDefaultClass \Drupal\subpathauto\PathProcessor @group subpathauto

Namespace

Drupal\Tests\subpathauto\Unit

Code

public function pathAliasCallback($path) {
  return $this->aliases[$path] ?? $path;
}