core/modules/book/src/Tests/BookTest.php | 11 +++++++++++ core/modules/comment/src/Tests/CommentAnonymousTest.php | 9 +++++++++ core/modules/contact/src/Tests/ContactSitewideTest.php | 11 +++++++++++ core/modules/forum/src/Tests/ForumTest.php | 13 +++++++++++++ core/modules/user/src/Form/UserPasswordResetForm.php | 1 - core/modules/user/src/Tests/UserLoginTest.php | 10 ++++++++++ core/modules/user/src/Tests/UserRegistrationTest.php | 9 +++++++++ 7 files changed, 63 insertions(+), 1 deletion(-) diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php index 330687d..fff456b 100644 --- a/core/modules/book/src/Tests/BookTest.php +++ b/core/modules/book/src/Tests/BookTest.php @@ -77,6 +77,17 @@ protected function setUp() { } /** + * Tests the presence of expected cache tags. + */ + function testCacheTags() { + $this->drupalLogin($this->bookAuthor); + + $this->drupalGet('node/add/book'); + $cache_tags = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags')); + $this->assertTrue(in_array('config:book.settings', $cache_tags)); + } + + /** * Creates a new book with a page hierarchy. */ function createBook() { diff --git a/core/modules/comment/src/Tests/CommentAnonymousTest.php b/core/modules/comment/src/Tests/CommentAnonymousTest.php index 8e1681c..7c8bd9a 100644 --- a/core/modules/comment/src/Tests/CommentAnonymousTest.php +++ b/core/modules/comment/src/Tests/CommentAnonymousTest.php @@ -31,6 +31,15 @@ protected function setUp() { } /** + * Tests the presence of expected cache tags. + */ + function testCacheTags() { + $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment'); + $cache_tags = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags')); + $this->assertTrue(in_array('config:user.settings', $cache_tags)); + } + + /** * Tests anonymous comment functionality. */ function testAnonymous() { diff --git a/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php index b2ff676..fcde3c6 100644 --- a/core/modules/contact/src/Tests/ContactSitewideTest.php +++ b/core/modules/contact/src/Tests/ContactSitewideTest.php @@ -41,6 +41,17 @@ 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'); + $cache_tags = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags')); + $this->assertTrue(in_array('config:contact.settings', $cache_tags)); + } + + /** * Tests configuration options and the site-wide contact form. */ function testSiteWideContact() { diff --git a/core/modules/forum/src/Tests/ForumTest.php b/core/modules/forum/src/Tests/ForumTest.php index 6feb754..2608de5 100644 --- a/core/modules/forum/src/Tests/ForumTest.php +++ b/core/modules/forum/src/Tests/ForumTest.php @@ -111,6 +111,19 @@ protected function setUp() { } /** + * Tests the presence of expected cache tags. + */ + function testCacheTags() { + $this->drupalGet(Url::fromRoute('forum.index')); + $cache_tags = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags')); + $this->assertTrue(in_array('config:forum.settings', $cache_tags)); + + $this->drupalGet(Url::fromRoute('forum.page', ['taxonomy_term' => 1])); + $cache_tags = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags')); + $this->assertTrue(in_array('config:forum.settings', $cache_tags)); + } + + /** * Tests forum functionality through the admin and user interfaces. */ function testForum() { diff --git a/core/modules/user/src/Form/UserPasswordResetForm.php b/core/modules/user/src/Form/UserPasswordResetForm.php index 129cacb..490965a 100644 --- a/core/modules/user/src/Form/UserPasswordResetForm.php +++ b/core/modules/user/src/Form/UserPasswordResetForm.php @@ -93,7 +93,6 @@ public function buildForm(array $form, FormStateInterface $form_state, AccountIn '#type' => 'submit', '#value' => $this->t('Log in'), ); - return $form; } diff --git a/core/modules/user/src/Tests/UserLoginTest.php b/core/modules/user/src/Tests/UserLoginTest.php index 0235983..1ffdddc 100644 --- a/core/modules/user/src/Tests/UserLoginTest.php +++ b/core/modules/user/src/Tests/UserLoginTest.php @@ -16,6 +16,16 @@ * @group user */ class UserLoginTest extends WebTestBase { + + /** + * Tests the presence of expected cache tags. + */ + function testCacheTags() { + $this->drupalGet('user/login'); + $cache_tags = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags')); + $this->assertTrue(in_array('config:system.site', $cache_tags)); + } + /** * Tests login with destination. */ diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php index f1eb637..24d4913 100644 --- a/core/modules/user/src/Tests/UserRegistrationTest.php +++ b/core/modules/user/src/Tests/UserRegistrationTest.php @@ -24,6 +24,15 @@ 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.