public function DisableLanguageManagerTest::testIsCurrentLanguageDisabledAndHasFallback in Disable language 8
Test isCurrentLanguageDisabled & getFallbackLanguage.
File
- tests/
src/ Kernel/ DisableLanguageManagerTest.php, line 83
Class
- DisableLanguageManagerTest
- @coversDefaultClass \Drupal\disable_language\DisableLanguageManager @group disable_language
Namespace
Drupal\Tests\disable_language\KernelCode
public function testIsCurrentLanguageDisabledAndHasFallback() {
$this
->assertFalse($this->disableLanguageManager
->isCurrentLanguageDisabled());
$this
->assertFalse($this->disableLanguageManager
->getFallbackLanguage());
\Drupal::configFactory()
->getEditable('system.site')
->set('default_langcode', 'fr')
->save();
$this
->assertTrue($this->disableLanguageManager
->isCurrentLanguageDisabled());
$this
->assertTrue($this->disableLanguageManager
->getFallbackLanguage() === 'nl');
}