You are here

public function LanguageDependencyInjectionTest::testDependencyInjectedNewLanguage in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/language/tests/src/Kernel/LanguageDependencyInjectionTest.php \Drupal\Tests\language\Kernel\LanguageDependencyInjectionTest::testDependencyInjectedNewLanguage()

Tests dependency injected languages against a new Language object.

See also

\Drupal\Core\Language\LanguageInterface

File

core/modules/language/tests/src/Kernel/LanguageDependencyInjectionTest.php, line 21

Class

LanguageDependencyInjectionTest
Compares the default language from $GLOBALS against the dependency injected language object.

Namespace

Drupal\Tests\language\Kernel

Code

public function testDependencyInjectedNewLanguage() {
  $expected = $this->languageManager
    ->getDefaultLanguage();
  $result = $this->languageManager
    ->getCurrentLanguage();
  $this
    ->assertSame($expected, $result);
}