function LanguageDependencyInjectionTest::testDependencyInjectedNewLanguage in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/language/src/Tests/LanguageDependencyInjectionTest.php \Drupal\language\Tests\LanguageDependencyInjectionTest::testDependencyInjectedNewLanguage()
Test dependency injected languages against a new Language object.
See also
\Drupal\Core\Language\LanguageInterface
File
- core/
modules/ language/ src/ Tests/ LanguageDependencyInjectionTest.php, line 26 - Contains \Drupal\language\Tests\LanguageDependencyInjectionTest.
Class
- LanguageDependencyInjectionTest
- Compares the default language from $GLOBALS against the dependency injected language object.
Namespace
Drupal\language\TestsCode
function testDependencyInjectedNewLanguage() {
$expected = $this->languageManager
->getDefaultLanguage();
$result = $this->languageManager
->getCurrentLanguage();
foreach ($expected as $property => $value) {
$this
->assertEqual($expected->{$property}, $result->{$property}, format_string('The dependency injected language object %prop property equals the new Language object %prop property.', array(
'%prop' => $property,
)));
}
}