class NonDefaultBlockAdminTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php \Drupal\Tests\block\Functional\NonDefaultBlockAdminTest
- 9 core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php \Drupal\Tests\block\Functional\NonDefaultBlockAdminTest
Tests the block administration page for a non-default theme.
@group block
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\block\Functional\NonDefaultBlockAdminTest
Expanded class hierarchy of NonDefaultBlockAdminTest
File
- core/
modules/ block/ tests/ src/ Functional/ NonDefaultBlockAdminTest.php, line 12
Namespace
Drupal\Tests\block\FunctionalView source
class NonDefaultBlockAdminTest extends BrowserTestBase {
/**
* Modules to install.
*
* @var array
*/
protected static $modules = [
'block',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this
->drupalPlaceBlock('local_tasks_block');
}
/**
* Tests non-default theme admin.
*/
public function testNonDefaultBlockAdmin() {
$admin_user = $this
->drupalCreateUser([
'administer blocks',
'administer themes',
]);
$this
->drupalLogin($admin_user);
$new_theme = 'olivero';
\Drupal::service('theme_installer')
->install([
$new_theme,
]);
// Ensure that the Olivero tab is shown.
$this
->drupalGet('admin/structure/block/list/' . $new_theme);
$this
->assertSession()
->pageTextContains('Olivero(active tab)');
}
}