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 @@ -67,4 +67,8 @@ $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. + $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'); + $fid = db_query("SELECT fid FROM {aggregator_feed} WHERE title = :title AND url = :url", array(':title' => $edit['title[0][value]'], ':url' => $edit['url[0][value]']))->fetchField(); $this->assertTrue(!empty($fid), 'The feed found in database.'); 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 @@ -43,4 +43,8 @@ $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. + $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'); + $fid = db_query("SELECT fid FROM {aggregator_feed} WHERE url = :url", array(':url' => $edit['url[0][value]']))->fetchField(); $feed = Feed::load($fid); 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 @@ -32,4 +32,8 @@ $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. + $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'); + // Check feed data. $this->assertUrl($feed->url('canonical', ['absolute' => TRUE])); 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 @@ -133,8 +133,16 @@ $this->assertText(t('Contact form @label has been added.', array('@label' => $label))); + // See if 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.'); + // Create first valid form. $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. + $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.'); + // Check that the form was created in site default language. $langcode = $this->config('contact.form.' . $id)->get('langcode'); 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 @@ -297,4 +297,9 @@ $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. + $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'); + $node = $this->drupalGetNodeByTitle($edit['title[0][value]']); $this->assertTrue($node, 'Node found in database.'); 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,6 +426,10 @@ format_string('@type was created', array('@type' => ucfirst($type))) ); + // See if 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'); + // Verify forum. $term = db_query("SELECT * FROM {taxonomy_term_field_data} t WHERE t.vid = :vid AND t.name = :name AND t.description__value = :desc AND t.default_langcode = 1", array(':vid' => $this->config('forum.settings')->get('vocabulary'), ':name' => $name, ':desc' => $description))->fetchAssoc(); $this->assertTrue(!empty($term), 'The ' . $type . ' exists in the database'); @@ -547,6 +551,10 @@ else { $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. + $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'); } // Retrieve node object, ensure that the topic was created and in the proper forum. 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 @@ -126,4 +126,8 @@ $this->assertText(t('@title has been updated.', array('@title' => $node_title))); + // See if 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'); + $this->drupalLogout(); } 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 @@ -55,4 +55,8 @@ $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. + $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'); + // Check that the node exists in the database. $node = $this->drupalGetNodeByTitle($edit['title[0][value]']); @@ -142,6 +146,10 @@ // 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. + $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/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 @@ -94,4 +94,8 @@ $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. + $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'); + // Check to make sure the node was created. $node = $this->drupalGetNodeByTitle($edit['title[0][value]']); 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,6 +246,9 @@ // 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. + $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 @@ -38,4 +38,8 @@ $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. + $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'); + $terms = taxonomy_term_load_multiple_by_name($edit['name[0][value]']); $term = reset($terms); @@ -50,4 +54,9 @@ $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. + $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'); + // Delete the vocabulary. $this->drupalGet('taxonomy/term/' . $term->id() . '/delete');