function ExamplesBrowserTestBase::setupExamplesMenus
Same name in other branches
- 3.x tests/src/Functional/ExamplesBrowserTestBase.php \Drupal\Tests\examples\Functional\ExamplesBrowserTestBase::setupExamplesMenus()
- 8.x-1.x tests/src/Functional/ExamplesBrowserTestBase.php \Drupal\Tests\examples\Functional\ExamplesBrowserTestBase::setupExamplesMenus()
Set up menus and tasks in their regions.
Since menus and tasks are now blocks, we're required to explicitly set them to regions. This method standardizes the way we do that for Examples.
Note that subclasses must explicitly declare that the block module is a dependency.
1 call to ExamplesBrowserTestBase::setupExamplesMenus()
- ExamplesBrowserTestBase::setUp in tests/
src/ Functional/ ExamplesBrowserTestBase.php
File
-
tests/
src/ Functional/ ExamplesBrowserTestBase.php, line 40
Class
- ExamplesBrowserTestBase
- A standardized base class for Examples tests.
Namespace
Drupal\Tests\examples\FunctionalCode
protected function setupExamplesMenus() {
$this->drupalPlaceBlock('system_menu_block:tools', [
'region' => 'primary_menu',
]);
$this->drupalPlaceBlock('local_tasks_block', [
'region' => 'secondary_menu',
]);
$this->drupalPlaceBlock('local_actions_block', [
'region' => 'content',
]);
$this->drupalPlaceBlock('page_title_block', [
'region' => 'content',
]);
}