You are here

function NonDefaultBlockAdminTest::testNonDefaultBlockAdmin in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/block/src/Tests/NonDefaultBlockAdminTest.php \Drupal\block\Tests\NonDefaultBlockAdminTest::testNonDefaultBlockAdmin()

Test non-default theme admin.

File

core/modules/block/src/Tests/NonDefaultBlockAdminTest.php, line 38
Contains \Drupal\block\Tests\NonDefaultBlockAdminTest.

Class

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

Namespace

Drupal\block\Tests

Code

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