function NonDefaultBlockAdminTest::testNonDefaultBlockAdmin

Same name in other branches
  1. 9 core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php \Drupal\Tests\block\Functional\NonDefaultBlockAdminTest::testNonDefaultBlockAdmin()
  2. 10 core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php \Drupal\Tests\block\Functional\NonDefaultBlockAdminTest::testNonDefaultBlockAdmin()
  3. 11.x core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php \Drupal\Tests\block\Functional\NonDefaultBlockAdminTest::testNonDefaultBlockAdmin()

Test non-default theme admin.

File

core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php, line 38

Class

NonDefaultBlockAdminTest
Tests the block administration page for a non-default theme.

Namespace

Drupal\Tests\block\Functional

Code

public function testNonDefaultBlockAdmin() {
    $admin_user = $this->drupalCreateUser([
        'administer blocks',
        'administer themes',
    ]);
    $this->drupalLogin($admin_user);
    $new_theme = 'bartik';
    \Drupal::service('theme_installer')->install([
        $new_theme,
    ]);
    $this->drupalGet('admin/structure/block/list/' . $new_theme);
    $this->assertText('Bartik(' . t('active tab') . ')', 'Tab for non-default theme found.');
}

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