class AdminPathEntityConverterLanguageTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php \Drupal\Tests\language\Functional\AdminPathEntityConverterLanguageTest
- 9 core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php \Drupal\Tests\language\Functional\AdminPathEntityConverterLanguageTest
Test administration path based conversion of entities.
@group language
Hierarchy
- class \Drupal\Tests\BrowserTestBase extends \PHPUnit\Framework\TestCase uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, FunctionalTestSetupTrait, TestSetupTrait, BlockCreationTrait, ConfigTestTrait, ExtensionListTestTrait, ContentTypeCreationTrait, NodeCreationTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings, UiHelperTrait, UserCreationTrait, XdebugRequestTrait
- class \Drupal\Tests\language\Functional\AdminPathEntityConverterLanguageTest
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\FunctionalView 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.');
}
}