You are here

public function TestingExampleMenuTest::testTestingNavigation in Examples for Developers 3.x

Same name and namespace in other branches
  1. 8 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
      ->assertLinkByHref($path);
  }
  $this
    ->drupalGet('/examples/testing-example');
  $this
    ->assertResponse(200);
}