diff --git a/vertical_tabs_example/src/Controller/VerticalTabsExampleController.php b/vertical_tabs_example/src/Controller/VerticalTabsExampleController.php index 5ba8b0a..e4b74be 100644 --- a/vertical_tabs_example/src/Controller/VerticalTabsExampleController.php +++ b/vertical_tabs_example/src/Controller/VerticalTabsExampleController.php @@ -26,9 +26,9 @@ class VerticalTabsExampleController { '#markup' => t('The Vertical Tabs Example shows how a custom module can add a vertical tab to a node edit form, and support its summary field with JavaScript. To see the - effects of this module, !add a piece of content and look at the set + effects of this module, @add a piece of content and look at the set of tabs beside. We\'ve added one called \'Example vertical tab.\'', - array('!add a piece of content' => $content_add) + array('@add a piece of content' => $content_add) ), ); return $build; diff --git a/vertical_tabs_example/src/Tests/VerticalTabsExampleTest.php b/vertical_tabs_example/src/Tests/VerticalTabsExampleTest.php index 197ce5e..2d65147 100644 --- a/vertical_tabs_example/src/Tests/VerticalTabsExampleTest.php +++ b/vertical_tabs_example/src/Tests/VerticalTabsExampleTest.php @@ -33,11 +33,24 @@ class VerticalTabsExampleTest extends WebTestBase { public function testVerticalTabsExampleMenus() { // Verify links on front-page. $this->drupalGet('examples/vertical_tabs'); - $this->assertResponse(200, '200 response for path: ' . $path); + $this->assertResponse(200, '200 response for path: examples/vertical_tabs'); $this->assertLinkByHref('node/add'); // Verify vertical tab on node/add/article. - $this->drupalGet('node/add'); - $this->clickLink('Article'); + $web_user = $this->drupalCreateUser(array( + 'access content', + 'access administration pages', + 'administer content types', + )); + $this->drupalLogin($web_user); + $this->contentTypeName = strtolower($this->randomMachineName(10)); + $this->drupalGet('admin/structure/types/add'); + $edit = array( + 'name' => $this->contentTypeName, + 'type' => $this->contentTypeName, + ); + $this->drupalPostForm(NULL, $edit, t('Save content type')); + $this->assertText(t('The content type @name has been added.', array('@name' => $this->contentTypeName))); + $this->drupalGet('node/add/' . $this->contentTypeName); $this->assertFieldByXPath("//details[@id='edit-vertical-tabs-example']"); }