public function PageExampleTest::providerMenuLinks in Examples for Developers 8
Same name and namespace in other branches
- 3.x modules/page_example/tests/src/Functional/PageExampleTest.php \Drupal\Tests\page_example\Functional\PageExampleTest::providerMenuLinks()
Data provider for testing menu links.
Return value
array
Array of page -> link relationships to check for, with the permissions required to access them:
- Permission machine name. Empty string means no login.
- Array of link information:
- Key is path to the page where the link should appear.
- Value is the link that should appear on the page.
File
- page_example/
tests/ src/ Functional/ PageExampleTest.php, line 86
Class
- PageExampleTest
- Creates page and render the content based on the arguments passed in the URL.
Namespace
Drupal\Tests\page_example\FunctionalCode
public function providerMenuLinks() {
return [
[
'',
[
'' => '/examples/page-example',
],
],
[
'access simple page',
[
'/examples/page-example' => '/examples/page-example/simple',
],
],
];
}