function AliasTest::testLookupByAlias

Same name in other branches
  1. 9 core/modules/path_alias/tests/src/Kernel/AliasTest.php \Drupal\Tests\path_alias\Kernel\AliasTest::testLookupByAlias()
  2. 8.9.x core/modules/path_alias/tests/src/Kernel/AliasTest.php \Drupal\Tests\path_alias\Kernel\AliasTest::testLookupByAlias()
  3. 11.x core/modules/path_alias/tests/src/Kernel/AliasTest.php \Drupal\Tests\path_alias\Kernel\AliasTest::testLookupByAlias()

@covers ::lookupByAlias

File

core/modules/path_alias/tests/src/Kernel/AliasTest.php, line 302

Class

AliasTest
Tests path alias CRUD and lookup functionality.

Namespace

Drupal\Tests\path_alias\Kernel

Code

public function testLookupByAlias() : void {
    $this->createPathAlias('/test-source', '/test-alias-Case');
    $path_alias_repository = $this->container
        ->get('path_alias.repository');
    $this->assertEquals('/test-source', $path_alias_repository->lookupByAlias('/test-alias-Case', LanguageInterface::LANGCODE_NOT_SPECIFIED)['path']);
    $this->assertEquals('/test-source', $path_alias_repository->lookupByAlias('/test-alias-case', LanguageInterface::LANGCODE_NOT_SPECIFIED)['path']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.