public function AliasPathProcessorTest::testProcessOutbound in Drupal 9
Same name and namespace in other branches
- 8 core/modules/path_alias/tests/src/Unit/PathProcessor/AliasPathProcessorTest.php \Drupal\Tests\path_alias\Unit\PathProcessor\AliasPathProcessorTest::testProcessOutbound()
@covers ::processOutbound
@dataProvider providerTestProcessOutbound
File
- core/
modules/ path_alias/ tests/ src/ Unit/ PathProcessor/ AliasPathProcessorTest.php, line 61
Class
- AliasPathProcessorTest
- @coversDefaultClass \Drupal\path_alias\PathProcessor\AliasPathProcessor @group PathProcessor @group path_alias
Namespace
Drupal\Tests\path_alias\Unit\PathProcessorCode
public function testProcessOutbound($path, array $options, $expected_path) {
$this->aliasManager
->expects($this
->any())
->method('getAliasByPath')
->willReturnMap([
[
'internal-url',
NULL,
'urlalias',
],
[
'url',
NULL,
'url',
],
]);
$bubbleable_metadata = new BubbleableMetadata();
$this
->assertEquals($expected_path, $this->pathProcessor
->processOutbound($path, $options, NULL, $bubbleable_metadata));
// Cacheability of paths replaced with path aliases is permanent.
// @todo https://www.drupal.org/node/2480077
$this
->assertEquals((new BubbleableMetadata())
->setCacheMaxAge(Cache::PERMANENT), $bubbleable_metadata);
}