diff --git a/contextual_links_example/tests/src/Functional/ContextualLinksExampleTest.php b/contextual_links_example/tests/src/Functional/ContextualLinksExampleTest.php index fd41a95..759eaa9 100644 --- a/contextual_links_example/tests/src/Functional/ContextualLinksExampleTest.php +++ b/contextual_links_example/tests/src/Functional/ContextualLinksExampleTest.php @@ -31,10 +31,11 @@ class ContextualLinksExampleTest extends BrowserTestBase { protected $profile = 'minimal'; /** - * Enable modules and create user with specific permissions. + * Tests contextual_links_example functionality. */ - protected function setUp() { - parent::setUp(); + public function testContextualLinksExampleBasic() { + $assert = $this->assertSession(); + // Create user. $web_user = $this->drupalCreateUser([ 'access contextual links', @@ -44,32 +45,16 @@ class ContextualLinksExampleTest extends BrowserTestBase { // Login the admin user. $this->drupalLogin($web_user); - // Create a node and promote it to the front page. Then view the front page - // and verify that the "Example action" contextual link works. - $this->drupalCreateNode(['promote' => 1]); - } - - /** - * Test for a link to the contextual example in the Tools menu. - */ - public function testContextualExampleLink() { + // We check for a link to the contextual example in the Tools menu. $this->drupalGet(''); $this->assertSession()->linkByHrefExists('examples/contextual-links'); - } - /** - * Tests contextual_links_example menus. - */ - public function testContextualExampleMenu() { $this->drupalGet('examples/contextual-links'); $this->assertSession()->statusCodeEquals(200); - } - /** - * Tests contextual_links_example functionality. - */ - public function testContextualLinksExampleBasic() { - $assert = $this->assertSession(); + // Create a node and promote it to the front page. Then view the front page + // and verify that the "Example action" contextual link works. + $this->drupalCreateNode(['promote' => 1]); $this->drupalGet(''); $assert->linkByHrefExists('/node/1/example-action?destination=node');