You are here

public function AliasPathProcessorTest::testProcessInbound in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/path_alias/tests/src/Unit/PathProcessor/AliasPathProcessorTest.php \Drupal\Tests\path_alias\Unit\PathProcessor\AliasPathProcessorTest::testProcessInbound()
  2. 9 core/modules/path_alias/tests/src/Unit/PathProcessor/AliasPathProcessorTest.php \Drupal\Tests\path_alias\Unit\PathProcessor\AliasPathProcessorTest::testProcessInbound()

Tests the processInbound method.

See also

\Drupal\path_alias\PathProcessor\AliasPathProcessor::processInbound

File

core/modules/path_alias/tests/src/Unit/PathProcessor/AliasPathProcessorTest.php, line 42

Class

AliasPathProcessorTest
@coversDefaultClass \Drupal\path_alias\PathProcessor\AliasPathProcessor @group PathProcessor @group path_alias

Namespace

Drupal\Tests\path_alias\Unit\PathProcessor

Code

public function testProcessInbound() {
  $this->aliasManager
    ->expects($this
    ->exactly(2))
    ->method('getPathByAlias')
    ->willReturnMap([
    [
      'urlalias',
      NULL,
      'internal-url',
    ],
    [
      'url',
      NULL,
      'url',
    ],
  ]);
  $request = Request::create('/urlalias');
  $this
    ->assertEquals('internal-url', $this->pathProcessor
    ->processInbound('urlalias', $request));
  $request = Request::create('/url');
  $this
    ->assertEquals('url', $this->pathProcessor
    ->processInbound('url', $request));
}