function LegacyAliasStorageTest::testGetAliasesForAdminListing

@covers ::getAliasesForAdminListing @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 207

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 testGetAliasesForAdminListing() {
    $this->storage
        ->save('/test-source-Case', '/test-alias-Case');
    $this->storage
        ->save('/another-test', '/another-test-alias');
    $expected_alias_1 = new \stdClass();
    $expected_alias_1->pid = '2';
    $expected_alias_1->source = '/another-test';
    $expected_alias_1->alias = '/another-test-alias';
    $expected_alias_1->langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED;
    $expected_alias_2 = new \stdClass();
    $expected_alias_2->pid = '1';
    $expected_alias_2->source = '/test-source-Case';
    $expected_alias_2->alias = '/test-alias-Case';
    $expected_alias_2->langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED;
    $header = [
        [
            'field' => 'alias',
            'sort' => 'asc',
        ],
    ];
    $this->assertEquals([
        $expected_alias_1,
        $expected_alias_2,
    ], $this->storage
        ->getAliasesForAdminListing($header));
}

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