class ToolbarTestSetup
Sets up the site for testing the toolbar module.
Hierarchy
- class \Drupal\Tests\toolbar\Nightwatch\ToolbarTestSetup implements \Drupal\TestSite\TestSetupInterface
Expanded class hierarchy of ToolbarTestSetup
File
-
core/
modules/ toolbar/ tests/ src/ Nightwatch/ ToolbarTestSetup.php, line 15
Namespace
Drupal\Tests\toolbar\NightwatchView source
class ToolbarTestSetup implements TestSetupInterface {
/**
* {@inheritdoc}
*/
public function setup() : void {
$module_installer = \Drupal::service('module_installer');
assert($module_installer instanceof ModuleInstallerInterface);
$module_installer->install([
'toolbar',
]);
$role = Role::load(RoleInterface::ANONYMOUS_ID);
foreach ([
'access toolbar',
'access administration pages',
'administer modules',
'administer site configuration',
'administer account settings',
] as $permission) {
$role->grantPermission($permission);
}
$role->save();
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
ToolbarTestSetup::setup | public | function | Overrides TestSetupInterface::setup |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.