Mercurial > hg > isophonics-drupal-site
comparison core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\Tests\language\Functional; | |
4 | |
5 use Drupal\language\Entity\ConfigurableLanguage; | |
6 use Drupal\Tests\BrowserTestBase; | |
7 | |
8 /** | |
9 * Test administration path based conversion of entities. | |
10 * | |
11 * @group language | |
12 */ | |
13 class AdminPathEntityConverterLanguageTest extends BrowserTestBase { | |
14 | |
15 public static $modules = ['language', 'language_test']; | |
16 | |
17 protected function setUp() { | |
18 parent::setUp(); | |
19 $permissions = [ | |
20 'access administration pages', | |
21 'administer site configuration', | |
22 ]; | |
23 $this->drupalLogin($this->drupalCreateUser($permissions)); | |
24 ConfigurableLanguage::createFromLangcode('es')->save(); | |
25 } | |
26 | |
27 /** | |
28 * Tests the translated and untranslated config entities are loaded properly. | |
29 */ | |
30 public function testConfigUsingCurrentLanguage() { | |
31 \Drupal::languageManager() | |
32 ->getLanguageConfigOverride('es', 'language.entity.es') | |
33 ->set('label', 'Español') | |
34 ->save(); | |
35 | |
36 $this->drupalGet('es/admin/language_test/entity_using_current_language/es'); | |
37 $this->assertNoRaw(t('Loaded %label.', ['%label' => 'Spanish'])); | |
38 $this->assertRaw(t('Loaded %label.', ['%label' => 'Español'])); | |
39 | |
40 $this->drupalGet('es/admin/language_test/entity_using_original_language/es'); | |
41 $this->assertRaw(t('Loaded %label.', ['%label' => 'Spanish'])); | |
42 $this->assertNoRaw(t('Loaded %label.', ['%label' => 'Español'])); | |
43 } | |
44 | |
45 } |