function LanguageBlockSettingsVisibilityTest::testUnnecessaryLanguageSettingsVisibility

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

File

core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php, line 26

Class

LanguageBlockSettingsVisibilityTest
Tests that the language settings on block config appears correctly.

Namespace

Drupal\Tests\language\Functional

Code

public function testUnnecessaryLanguageSettingsVisibility() : void {
    $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");
}

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