You are here

public function AdminPathEntityConverterLanguageTest::testConfigUsingCurrentLanguage in Drupal 9

Same name and namespace in other branches
  1. 8 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
    ->assertSession()
    ->pageTextNotContains('Loaded Spanish.');
  $this
    ->assertSession()
    ->pageTextContains('Loaded Español.');
  $this
    ->drupalGet('es/admin/language_test/entity_using_original_language/es');
  $this
    ->assertSession()
    ->pageTextContains('Loaded Spanish.');
  $this
    ->assertSession()
    ->pageTextNotContains('Loaded Español.');
}