function LanguageDependencyInjectionTest::testDependencyInjectedNewLanguage

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

Class

LanguageDependencyInjectionTest
Tests that a language object can be injected.

Namespace

Drupal\Tests\language\Kernel

Code

public function testDependencyInjectedNewLanguage() {
    $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.