function LegacyAliasStorageTest::testLoad

@covers ::load @expectedDeprecation \Drupal\Core\Path\AliasStorage is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use the "path_alias.repository" service instead, or the entity storage handler for the "path_alias" entity type for CRUD methods. See https://www.drupal.org/node/3013865.

File

core/tests/Drupal/KernelTests/Core/Path/LegacyAliasStorageTest.php, line 39

Class

LegacyAliasStorageTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Path%21AliasStorage.php/class/AliasStorage/8.9.x" title="Provides a class for CRUD operations on path aliases." class="local">\Drupal\Core\Path\AliasStorage</a> @group path @group legacy

Namespace

Drupal\KernelTests\Core\Path

Code

public function testLoad() {
    $this->storage
        ->save('/test-source-Case', '/test-alias-Case');
    $expected = [
        'pid' => 1,
        'alias' => '/test-alias-Case',
        'source' => '/test-source-Case',
        'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
    ];
    $this->assertEquals($expected, $this->storage
        ->load([
        'alias' => '/test-alias-Case',
    ]));
    $this->assertEquals($expected, $this->storage
        ->load([
        'alias' => '/test-alias-case',
    ]));
    $this->assertEquals($expected, $this->storage
        ->load([
        'source' => '/test-source-Case',
    ]));
    $this->assertEquals($expected, $this->storage
        ->load([
        'source' => '/test-source-case',
    ]));
}

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