function PageExampleTest::providerMenuLinks

Same name in other branches
  1. 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

modules/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\Functional

Code

public function providerMenuLinks() {
    return [
        [
            '',
            [
                '' => '/examples/page-example',
            ],
        ],
        [
            'access simple page',
            [
                '/examples/page-example' => '/examples/page-example/simple',
            ],
        ],
    ];
}