function BlockTest::testThemeAdminLink

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

Tests that a link exists to block layout from the appearance form.

File

core/modules/block/tests/src/Functional/BlockTest.php, line 512

Class

BlockTest
Tests basic block functionality.

Namespace

Drupal\Tests\block\Functional

Code

public function testThemeAdminLink() {
    $this->drupalPlaceBlock('help_block', [
        'region' => 'help',
    ]);
    $theme_admin = $this->drupalCreateUser([
        'administer blocks',
        'administer themes',
        'access administration pages',
    ]);
    $this->drupalLogin($theme_admin);
    $this->drupalGet('admin/appearance');
    $this->assertSession()
        ->pageTextContains('You can place blocks for each theme on the block layout page');
    $this->assertSession()
        ->linkByHrefExists('admin/structure/block');
}

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