You are here

public function LegacyAliasStorageTest::testGetAliasesForAdminListing in Drupal 8

@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 \Drupal\Core\Path\AliasStorage @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));
}