diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php
index af8c107..8334aaa 100644
--- a/core/modules/book/src/Tests/BookTest.php
+++ b/core/modules/book/src/Tests/BookTest.php
@@ -77,16 +77,6 @@ protected function setUp() {
}
/**
- * Tests the presence of expected cache tags.
- */
- function testCacheTags() {
- $this->drupalLogin($this->bookAuthor);
-
- $this->drupalGet('node/add/book');
- $this->assertCacheTag('config:book.settings');
- }
-
- /**
* Creates a new book with a page hierarchy.
*/
function createBook() {
@@ -153,6 +143,11 @@ function testBook() {
$this->drupalLogout();
$this->drupalLogin($this->bookAuthor);
+
+ // Check the presence of expected cache tags.
+ $this->drupalGet('node/add/book');
+ $this->assertCacheTag('config:book.settings');
+
/*
* Add Node 5 under Node 3.
* Book
@@ -163,8 +158,6 @@ function testBook() {
* |- Node 5
* |- Node 4
*/
-
-
$nodes[] = $this->createBookNode($book->id(), $nodes[3]->book['nid']); // Node 5.
$this->drupalLogout();
$this->drupalLogin($this->webUser);
diff --git a/core/modules/comment/src/Tests/CommentAnonymousTest.php b/core/modules/comment/src/Tests/CommentAnonymousTest.php
index 75afe02..8305651 100644
--- a/core/modules/comment/src/Tests/CommentAnonymousTest.php
+++ b/core/modules/comment/src/Tests/CommentAnonymousTest.php
@@ -31,14 +31,6 @@ protected function setUp() {
}
/**
- * Tests the presence of expected cache tags.
- */
- function testCacheTags() {
- $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment');
- $this->assertCacheTag('config:user.settings');
- }
-
- /**
* Tests anonymous comment functionality.
*/
function testAnonymous() {
@@ -64,6 +56,9 @@ function testAnonymous() {
$this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment');
$this->assertTrue($this->commentContactInfoAvailable(), 'Contact information available.');
+ // Check the presence of expected cache tags.
+ $this->assertCacheTag('config:user.settings');
+
$anonymous_comment2 = $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName());
$this->assertTrue($this->commentExists($anonymous_comment2), 'Anonymous comment with contact info (optional) found.');
diff --git a/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php
index f23258b..b73c646 100644
--- a/core/modules/contact/src/Tests/ContactSitewideTest.php
+++ b/core/modules/contact/src/Tests/ContactSitewideTest.php
@@ -41,16 +41,6 @@ protected function setUp() {
}
/**
- * Tests the presence of expected cache tags.
- */
- function testCacheTags() {
- $this->drupalLogin($this->drupalCreateUser(array('access site-wide contact form')));
-
- $this->drupalGet('contact');
- $this->assertCacheTag('config:contact.settings');
- }
-
- /**
* Tests configuration options and the site-wide contact form.
*/
function testSiteWideContact() {
@@ -64,6 +54,10 @@ function testSiteWideContact() {
));
$this->drupalLogin($admin_user);
+ // Check the presence of expected cache tags.
+ $this->drupalGet('contact');
+ $this->assertCacheTag('config:contact.settings');
+
$flood_limit = 3;
$this->config('contact.settings')
->set('flood.limit', $flood_limit)
diff --git a/core/modules/forum/src/Tests/ForumTest.php b/core/modules/forum/src/Tests/ForumTest.php
index ede4817..e75507a 100644
--- a/core/modules/forum/src/Tests/ForumTest.php
+++ b/core/modules/forum/src/Tests/ForumTest.php
@@ -111,17 +111,6 @@ protected function setUp() {
}
/**
- * Tests the presence of expected cache tags.
- */
- function testCacheTags() {
- $this->drupalGet(Url::fromRoute('forum.index'));
- $this->assertCacheTag('config:forum.settings');
-
- $this->drupalGet(Url::fromRoute('forum.page', ['taxonomy_term' => 1]));
- $this->assertCacheTag('config:forum.settings');
- }
-
- /**
* Tests forum functionality through the admin and user interfaces.
*/
function testForum() {
@@ -130,6 +119,12 @@ function testForum() {
// Look for the "General discussion" default forum
$this->assertRaw(t('General discussion'), "Found the default forum at the /forum listing");
+ // Check the presence of expected cache tags.
+ $this->assertCacheTag('config:forum.settings');
+
+ $this->drupalGet(Url::fromRoute('forum.page', ['taxonomy_term' => 1]));
+ $this->assertCacheTag('config:forum.settings');
+
// Do the admin tests.
$this->doAdminTests($this->admin_user);
diff --git a/core/modules/user/src/Tests/UserLoginTest.php b/core/modules/user/src/Tests/UserLoginTest.php
index 3b17163..27ffa2a 100644
--- a/core/modules/user/src/Tests/UserLoginTest.php
+++ b/core/modules/user/src/Tests/UserLoginTest.php
@@ -18,19 +18,14 @@
class UserLoginTest extends WebTestBase {
/**
- * Tests the presence of expected cache tags.
+ * Tests login with destination.
*/
- function testCacheTags() {
+ function testLoginCacheTagsAndDestination() {
$this->drupalGet('user/login');
// The user login form says "Enter your username.", hence it
// depends on config:system.site, and its cache tags should be present.
$this->assertCacheTag('config:system.site');
- }
- /**
- * Tests login with destination.
- */
- function testLoginDestination() {
$user = $this->drupalCreateUser(array());
$this->drupalGet('user/login', array('query' => array('destination' => 'foo')));
$edit = array('name' => $user->getUserName(), 'pass' => $user->pass_raw);
diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php
index d2c7b38..447a7cb 100644
--- a/core/modules/user/src/Tests/UserRegistrationTest.php
+++ b/core/modules/user/src/Tests/UserRegistrationTest.php
@@ -24,15 +24,6 @@ class UserRegistrationTest extends WebTestBase {
*/
public static $modules = array('field_test');
- /**
- * Tests the presence of expected cache tags.
- */
- function testCacheTags() {
- $this->drupalGet('user/register');
- $cache_tags = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags'));
- $this->assertTrue(in_array('config:user.settings', $cache_tags));
- }
-
function testRegistrationWithEmailVerification() {
$config = $this->config('user.settings');
// Require email verification.
@@ -178,6 +169,9 @@ function testRegistrationDefaultValues() {
$this->drupalGet('user/register');
$this->assertNoRaw('Account information
');
+ // Check the presence of expected cache tags.
+ $this->assertCacheTag('config:user.settings');
+
$edit = array();
$edit['name'] = $name = $this->randomMachineName();
$edit['mail'] = $mail = $edit['name'] . '@example.com';