function LanguageDependencyInjectionTest::testDependencyInjectedNewLanguage

Same name in other branches
  1. 9 core/modules/language/tests/src/Kernel/LanguageDependencyInjectionTest.php \Drupal\Tests\language\Kernel\LanguageDependencyInjectionTest::testDependencyInjectedNewLanguage()
  2. 8.9.x core/modules/language/tests/src/Kernel/LanguageDependencyInjectionTest.php \Drupal\Tests\language\Kernel\LanguageDependencyInjectionTest::testDependencyInjectedNewLanguage()
  3. 11.x 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 22

Class

LanguageDependencyInjectionTest
Tests that a language object can be injected.

Namespace

Drupal\Tests\language\Kernel

Code

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

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