function AliasManagerTest::setUpCurrentLanguage

Sets up the current language.

Return value

\Drupal\Core\Language\LanguageInterface The current language object.

6 calls to AliasManagerTest::setUpCurrentLanguage()
AliasManagerTest::testCacheClear in core/modules/path_alias/tests/src/Unit/AliasManagerTest.php
Tests cache clear.
AliasManagerTest::testGetAliasByPathCachedMissLanguage in core/modules/path_alias/tests/src/Unit/AliasManagerTest.php
Tests the getAliasByPath cache when a different language is requested.
AliasManagerTest::testGetAliasByPathMatch in core/modules/path_alias/tests/src/Unit/AliasManagerTest.php
Tests the getAliasByPath method for a path that has a matching alias.
AliasManagerTest::testGetAliasByPathNoMatch in core/modules/path_alias/tests/src/Unit/AliasManagerTest.php
Tests the getAliasByPath method for a path that has no matching alias.
AliasManagerTest::testGetAliasByPathPrefixList in core/modules/path_alias/tests/src/Unit/AliasManagerTest.php
Tests the getAliasByPath method for a path that is not in the prefix list.

... See full list

File

core/modules/path_alias/tests/src/Unit/AliasManagerTest.php, line 319

Class

AliasManagerTest
Tests Drupal\path_alias\AliasManager.

Namespace

Drupal\Tests\path_alias\Unit

Code

protected function setUpCurrentLanguage() {
  $language = new Language([
    'id' => 'en',
  ]);
  $this->languageManager
    ->expects($this->any())
    ->method('getCurrentLanguage')
    ->with(LanguageInterface::TYPE_URL)
    ->willReturn($language);
  return $language;
}

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