LocaleLocaleLookupTest.php in Zircon Profile 8.0
File
core/modules/locale/src/Tests/LocaleLocaleLookupTest.php
View source
<?php
namespace Drupal\locale\Tests;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\simpletest\WebTestBase;
class LocaleLocaleLookupTest extends WebTestBase {
public static $modules = array(
'locale',
'locale_test',
);
public function setUp() {
parent::setUp();
ConfigurableLanguage::createFromLangcode('fr')
->save();
$this
->config('system.site')
->set('default_langcode', 'fr')
->save();
$this
->drupalLogin($this->rootUser);
}
public function testCircularDependency() {
$this
->drupalPostForm('admin/modules', array(
'modules[Testing][early_translation_test][enable]' => TRUE,
), t('Install'));
$this
->assertResponse(200);
}
public function testLanguageFallbackDefaults() {
$this
->drupalGet('');
$this
->assertEqual(\Drupal::state()
->get('locale.test_language_fallback_candidates_locale_lookup_alter_candidates'), array());
$context = \Drupal::state()
->get('locale.test_language_fallback_candidates_locale_lookup_alter_context');
$this
->assertEqual($context['langcode'], 'fr');
$this
->assertEqual($context['operation'], 'locale_lookup');
}
}