function AdminPathEntityConverterLanguageTest::testConfigUsingCurrentLanguage

Same name in other branches
  1. 9 core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php \Drupal\Tests\language\Functional\AdminPathEntityConverterLanguageTest::testConfigUsingCurrentLanguage()
  2. 10 core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php \Drupal\Tests\language\Functional\AdminPathEntityConverterLanguageTest::testConfigUsingCurrentLanguage()
  3. 11.x core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php \Drupal\Tests\language\Functional\AdminPathEntityConverterLanguageTest::testConfigUsingCurrentLanguage()

Tests the translated and untranslated config entities are loaded properly.

File

core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php, line 35

Class

AdminPathEntityConverterLanguageTest
Test administration path based conversion of entities.

Namespace

Drupal\Tests\language\Functional

Code

public function testConfigUsingCurrentLanguage() {
    \Drupal::languageManager()->getLanguageConfigOverride('es', 'language.entity.es')
        ->set('label', 'Español')
        ->save();
    $this->drupalGet('es/admin/language_test/entity_using_current_language/es');
    $this->assertNoRaw(t('Loaded %label.', [
        '%label' => 'Spanish',
    ]));
    $this->assertRaw(t('Loaded %label.', [
        '%label' => 'Español',
    ]));
    $this->drupalGet('es/admin/language_test/entity_using_original_language/es');
    $this->assertRaw(t('Loaded %label.', [
        '%label' => 'Spanish',
    ]));
    $this->assertNoRaw(t('Loaded %label.', [
        '%label' => 'Español',
    ]));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.