diff -u b/core/modules/aggregator/src/Tests/AggregatorTestBase.php b/core/modules/aggregator/src/Tests/AggregatorTestBase.php --- b/core/modules/aggregator/src/Tests/AggregatorTestBase.php +++ b/core/modules/aggregator/src/Tests/AggregatorTestBase.php @@ -66,7 +66,7 @@ $this->drupalPostForm('aggregator/sources/add', $edit, t('Save')); $this->assertText(t('The feed @name has been added.', array('@name' => $edit['title[0][value]'])), format_string('The feed !name has been added.', array('!name' => $edit['title[0][value]']))); - // See if the creation message contains a link to a feed. + // Verify that the creation message contains a link to a feed. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'aggregator/sources/')); $this->assert(isset($view_link), 'The message area contains a link to a feed'); diff -u b/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php b/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php --- b/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php +++ b/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php @@ -42,7 +42,7 @@ $this->drupalPostForm('aggregator/sources/add', $edit, t('Save')); $this->assertText(t('The feed @name has been added.', array('@name' => $edit['title[0][value]'])), format_string('The feed !name has been added.', array('!name' => $edit['title[0][value]']))); - // See if the creation message contains a link to a feed. + // Verify that the creation message contains a link to a feed. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'aggregator/sources/')); $this->assert(isset($view_link), 'The message area contains a link to a feed'); diff -u b/core/modules/aggregator/src/Tests/UpdateFeedTest.php b/core/modules/aggregator/src/Tests/UpdateFeedTest.php --- b/core/modules/aggregator/src/Tests/UpdateFeedTest.php +++ b/core/modules/aggregator/src/Tests/UpdateFeedTest.php @@ -31,7 +31,7 @@ $this->drupalPostForm('aggregator/sources/' . $feed->id() . '/configure', $edit, t('Save')); $this->assertText(t('The feed @name has been updated.', array('@name' => $edit['title[0][value]'])), format_string('The feed %name has been updated.', array('%name' => $edit['title[0][value]']))); - // See if the creation message contains a link to a feed. + // Verify that the creation message contains a link to a feed. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'aggregator/sources/')); $this->assert(isset($view_link), 'The message area contains a link to a feed'); diff -u b/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php --- b/core/modules/contact/src/Tests/ContactSitewideTest.php +++ b/core/modules/contact/src/Tests/ContactSitewideTest.php @@ -132,7 +132,7 @@ $this->addContactForm($id = Unicode::strtolower($this->randomMachineName($max_length)), $label = $this->randomMachineName($max_length), implode(',', array($recipients[0])), '', TRUE); $this->assertText(t('Contact form @label has been added.', array('@label' => $label))); - // See if the creation message contains a link to a contact form. + // Verify that the creation message contains a link to a contact form. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'contact/')); $this->assert(isset($view_link), 'The message area contains a link to a contact form.'); @@ -140,7 +140,7 @@ $this->addContactForm($id = Unicode::strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', array($recipients[0])), '', TRUE); $this->assertText(t('Contact form @label has been added.', array('@label' => $label))); - // See if the creation message contains a link to a contact form. + // Verify that the creation message contains a link to a contact form. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'contact/')); $this->assert(isset($view_link), 'The message area contains a link to a contact form.'); diff -u b/core/modules/filter/src/Tests/FilterAdminTest.php b/core/modules/filter/src/Tests/FilterAdminTest.php --- b/core/modules/filter/src/Tests/FilterAdminTest.php +++ b/core/modules/filter/src/Tests/FilterAdminTest.php @@ -296,8 +296,7 @@ $this->drupalPostForm('node/add/page', $edit, t('Save')); $this->assertText(t('Basic page @title has been created.', array('@title' => $edit['title[0][value]'])), 'Filtered node created.'); - - // See if the creation message contains a link to a node. + // Verify that the creation message contains a link to a node. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'node/')); $this->assert(isset($view_link), 'The message area contains a link to a node'); diff -u b/core/modules/forum/src/Tests/ForumTest.php b/core/modules/forum/src/Tests/ForumTest.php --- b/core/modules/forum/src/Tests/ForumTest.php +++ b/core/modules/forum/src/Tests/ForumTest.php @@ -426,7 +426,7 @@ format_string('@type was created', array('@type' => ucfirst($type))) ); - // See if the creation message contains a link to a term. + // Verify that the creation message contains a link to a term. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'term/')); $this->assert(isset($view_link), 'The message area contains a link to a term'); @@ -552,7 +552,7 @@ $this->assertText(t('@type @title has been created.', array('@type' => $type, '@title' => $title)), 'Forum topic was created'); $this->assertNoRaw(t('The item %title is a forum container, not a forum.', array('%title' => $forum['name'])), 'No error message was shown'); - // See if the creation message contains a link to a term. + // Verify that the creation message contains a link to a term. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'term/')); $this->assert(isset($view_link), 'The message area contains a link to a term'); } diff -u b/core/modules/locale/src/Tests/LocaleContentTest.php b/core/modules/locale/src/Tests/LocaleContentTest.php --- b/core/modules/locale/src/Tests/LocaleContentTest.php +++ b/core/modules/locale/src/Tests/LocaleContentTest.php @@ -125,7 +125,7 @@ $this->drupalPostForm($path, $edit, t('Save')); $this->assertText(t('@title has been updated.', array('@title' => $node_title))); - // See if the creation message contains a link to a node. + // Verify that the creation message contains a link to a node. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'node/' . $node->id())); $this->assert(isset($view_link), 'The message area contains the link to the edited node'); diff -u b/core/modules/node/src/Tests/NodeCreationTest.php b/core/modules/node/src/Tests/NodeCreationTest.php --- b/core/modules/node/src/Tests/NodeCreationTest.php +++ b/core/modules/node/src/Tests/NodeCreationTest.php @@ -54,7 +54,7 @@ // Check that the Basic page has been created. $this->assertText(t('!post @title has been created.', array('!post' => 'Basic page', '@title' => $edit['title[0][value]'])), 'Basic page created.'); - // See if the creation message contains a link to a node. + // Verify that the creation message contains a link to a node. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'node/')); $this->assert(isset($view_link), 'The message area contains a link to a node'); @@ -147,7 +147,7 @@ // Confirm that the node was created. $this->assertText(t('!post @title has been created.', array('!post' => 'Basic page', '@title' => $edit['title[0][value]']))); - // See if the creation message contains a link to a node. + // Verify that the creation message contains a link to a node. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'node/')); $this->assert(isset($view_link), 'The message area contains a link to a node'); } diff -u b/core/modules/shortcut/src/ShortcutForm.php b/core/modules/shortcut/src/ShortcutForm.php --- b/core/modules/shortcut/src/ShortcutForm.php +++ b/core/modules/shortcut/src/ShortcutForm.php @@ -29,12 +29,10 @@ $entity = $this->entity; $status = $entity->save(); $url = $entity->getUrl(); - /* - * There's an edge case where a user can have permission to - * 'link to any content', but has no right to access the linked page. - * So we check the access before showing the link - */ - if ($url->access() == TRUE) { + // There's an edge case where a user can have permission to + // 'link to any content', but has no right to access the linked page. So we + // check the access before showing the link. + if ($url->access()) { $view_link = \Drupal::l($entity->getTitle(), $url); } else { diff -u b/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php b/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php --- b/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php +++ b/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php @@ -93,7 +93,7 @@ $this->drupalPostForm('node/add/page', $edit, t('Save')); $this->assertText(t('Basic page @title has been created.', array('@title' => $edit['title[0][value]'])), 'Basic page created.'); - // See if the creation message contains a link to a node. + // Verify that the creation message contains a link to a node. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'node/')); $this->assert(isset($view_link), 'The message area contains a link to a node'); diff -u b/core/modules/taxonomy/src/Tests/TermTest.php b/core/modules/taxonomy/src/Tests/TermTest.php --- b/core/modules/taxonomy/src/Tests/TermTest.php +++ b/core/modules/taxonomy/src/Tests/TermTest.php @@ -246,9 +246,11 @@ // Save, creating the terms. $this->drupalPostForm('node/add/article', $edit, t('Save')); $this->assertText(t('@type @title has been created.', array('@type' => t('Article'), '@title' => $edit['title[0][value]'])), 'The node was created successfully.'); - // See if the creation message contains a link to a node. + + // Verify that the creation message contains a link to a node. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'node/')); $this->assert(isset($view_link), 'The message area contains a link to a node'); + foreach ($terms as $term) { $this->assertText($term, 'The term was saved and appears on the node page.'); } diff -u b/core/modules/taxonomy/src/Tests/VocabularyPermissionsTest.php b/core/modules/taxonomy/src/Tests/VocabularyPermissionsTest.php --- b/core/modules/taxonomy/src/Tests/VocabularyPermissionsTest.php +++ b/core/modules/taxonomy/src/Tests/VocabularyPermissionsTest.php @@ -37,7 +37,7 @@ $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertText(t('Created new term @name.', array('@name' => $edit['name[0][value]'])), 'Term created successfully.'); - // See if the creation message contains a link to a term. + // Verify that the creation message contains a link to a term. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'term/')); $this->assert(isset($view_link), 'The message area contains a link to a term'); @@ -53,8 +53,7 @@ $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertText(t('Updated term @name.', array('@name' => $edit['name[0][value]'])), 'Term updated successfully.'); - - // See if the update message contains a link to a term. + // Verify that the update message contains a link to a term. $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', array(':href' => 'term/')); $this->assert(isset($view_link), 'The message area contains a link to a term');