You are here

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

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

Parameters

string $path: The path.

Return value

string An alias that represents the path, or path if no alias was found.

File

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

Class

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

Namespace

Drupal\Tests\subpathauto\Unit

Code

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