class LanguageBlockSettingsVisibilityTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php \Drupal\Tests\language\Functional\LanguageBlockSettingsVisibilityTest
- 9 core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php \Drupal\Tests\language\Functional\LanguageBlockSettingsVisibilityTest
Tests that the language settings on block config appears correctly.
@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\LanguageBlockSettingsVisibilityTest
Expanded class hierarchy of LanguageBlockSettingsVisibilityTest
File
- core/
modules/ language/ tests/ src/ Functional/ LanguageBlockSettingsVisibilityTest.php, line 12
Namespace
Drupal\Tests\language\FunctionalView source
class LanguageBlockSettingsVisibilityTest extends BrowserTestBase {
protected static $modules = [
'block',
'language',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
public function testUnnecessaryLanguageSettingsVisibility() {
$admin_user = $this
->drupalCreateUser([
'administer languages',
'access administration pages',
'administer blocks',
]);
$this
->drupalLogin($admin_user);
$this
->drupalGet('admin/config/regional/language/add');
$this
->submitForm([
'predefined_langcode' => 'hu',
], 'Add language');
$this
->drupalGet('admin/structure/block/add/system_menu_block:admin/stark');
$this
->assertSession()
->fieldNotExists("edit-visibility-language-langcodes-und");
$this
->assertSession()
->fieldNotExists("edit-visibility-language-langcodes-zxx");
$this
->assertSession()
->fieldExists("edit-visibility-language-langcodes-en");
$this
->assertSession()
->fieldExists("edit-visibility-language-langcodes-hu");
}
}