You are here

public function LanguageDependencyInjectionTest::testDependencyInjectedNewLanguage in Drupal 8

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

Test 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);
}