function TestingExampleMenuTest::testTestingNavigation

Same name in other branches
  1. 3.x modules/testing_example/tests/src/Functional/TestingExampleMenuTest.php \Drupal\Tests\testing_example\Functional\TestingExampleMenuTest::testTestingNavigation()
  2. 8.x-1.x testing_example/tests/src/Functional/TestingExampleMenuTest.php \Drupal\Tests\testing_example\Functional\TestingExampleMenuTest::testTestingNavigation()

Verify and validate that default menu links were loaded for this module.

File

modules/testing_example/tests/src/Functional/TestingExampleMenuTest.php, line 45

Class

TestingExampleMenuTest
Test the user-facing menus in Testing Example.

Namespace

Drupal\Tests\testing_example\Functional

Code

public function testTestingNavigation() {
    foreach ([
        '' => '/examples/testing-example',
    ] as $page => $path) {
        $this->drupalGet($page);
        $this->assertSession()
            ->linkByHrefExists($path);
    }
    $this->drupalGet('/examples/testing-example');
    $this->assertSession()
        ->statusCodeEquals(200);
}