public function NodeTypeExampleTest::testNodeTypeExample in Examples for Developers 3.x
Same name and namespace in other branches
- 8 node_type_example/tests/src/Functional/NodeTypeExampleTest.php \Drupal\Tests\node_type_example\Functional\NodeTypeExampleTest::testNodeTypeExample()
Verify and validate that default menu links were loaded for this module.
File
- modules/
node_type_example/ tests/ src/ Functional/ NodeTypeExampleTest.php, line 60
Class
- NodeTypeExampleTest
- Test that our content types are successfully created.
Namespace
Drupal\Tests\node_type_example\FunctionalCode
public function testNodeTypeExample() {
$assert = $this
->assertSession();
// Test that our page loads.
$this
->drupalGet('/examples/node-type-example');
$assert
->statusCodeEquals(200);
// Test that our menu links were created.
$links = $this
->providerMenuLinks();
foreach ($links as $page => $path) {
$this
->drupalGet($page);
$assert
->linkByHrefExists($path);
}
}