You are here

public function LanguageNeutralAliasesStorageTest::testLoad in Language neutral aliases 8

Test that load() only returns language neutral aliases.

File

tests/src/Kernel/LanguageNeutralAliasesStorageTest.php, line 146

Class

LanguageNeutralAliasesStorageTest
Test language neutral aliases.

Namespace

Drupal\Tests\language_neutral_aliases\Kernel

Code

public function testLoad() {
  $storage = $this->container
    ->get('path.alias_storage');
  $this
    ->assertFalse($storage
    ->load([
    $this->field => '/node/1',
  ]));
  $this
    ->assertFalse($storage
    ->load([
    $this->field => '/node/2',
  ]));
  $this
    ->assertNotFalse($storage
    ->load([
    $this->field => '/node/3',
  ]));

  // Check that specified language is ignored.
  $this
    ->assertNotFalse($storage
    ->load([
    $this->field => '/node/3',
    'langcode' => 'de',
  ]));
}