You are here

class AdminPathEntityConverterLanguageTest in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php \Drupal\Tests\language\Functional\AdminPathEntityConverterLanguageTest
  2. 9 core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php \Drupal\Tests\language\Functional\AdminPathEntityConverterLanguageTest

Test administration path based conversion of entities.

@group language

Hierarchy

Expanded class hierarchy of AdminPathEntityConverterLanguageTest

1 file declares its use of AdminPathEntityConverterLanguageTest
ContentModerationAdminPathEntityConverterLanguageTest.php in core/modules/content_moderation/tests/src/Functional/ContentModerationAdminPathEntityConverterLanguageTest.php

File

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

Namespace

Drupal\Tests\language\Functional
View source
class AdminPathEntityConverterLanguageTest extends BrowserTestBase {
  protected static $modules = [
    'language',
    'language_test',
  ];

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';
  protected function setUp() : void {
    parent::setUp();
    $permissions = [
      'access administration pages',
      'administer site configuration',
    ];
    $this
      ->drupalLogin($this
      ->drupalCreateUser($permissions));
    ConfigurableLanguage::createFromLangcode('es')
      ->save();
  }

  /**
   * Tests the translated and untranslated config entities are loaded properly.
   */
  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.');
  }

}

Members