diff --git a/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php b/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php index bd0453796fbe..31a11f83be37 100644 --- a/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php +++ b/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php @@ -169,7 +169,7 @@ class CommentAnonymousTest extends CommentTestBase { // NOTE: if authenticated user has permission to post comments, then a // "Login or register to post comments" type link may be shown. $this->drupalGet('node/' . $this->node->id()); - $this->assertNoPattern('@]*>Comments@', 'Comments were not displayed.'); + $this->assertSession()->responseNotMatches('@]*>Comments@', 'Comments were not displayed.'); $this->assertNoLink('Add new comment', 'Link to add comment was found.'); // Attempt to view node-comment form while disallowed. @@ -192,7 +192,7 @@ class CommentAnonymousTest extends CommentTestBase { 'skip comment approval' => TRUE, ]); $this->drupalGet('node/' . $this->node->id()); - $this->assertNoPattern('@]*>Comments@', 'Comments were not displayed.'); + $this->assertSession()->responseNotMatches('@]*>Comments@', 'Comments were not displayed.'); $this->assertFieldByName('subject[0][value]', '', 'Subject field found.'); $this->assertFieldByName('comment_body[0][value]', '', 'Comment field found.'); diff --git a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php index a2c0d4a55e59..4a603ca9eca2 100644 --- a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php +++ b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php @@ -26,7 +26,7 @@ class CommentInterfaceTest extends CommentTestBase { // Make sure that comment field title is not displayed when there's no // comments posted. $this->drupalGet($this->node->urlInfo()); - $this->assertNoPattern('@]*>Comments@', 'Comments title is not displayed.'); + $this->assertSession()->responseNotMatches('@]*>Comments@', 'Comments title is not displayed.'); // Set comments to have subject and preview disabled. $this->setCommentPreview(DRUPAL_DISABLED); diff --git a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php index 27c096444acc..378fb9574b4a 100644 --- a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php +++ b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php @@ -341,7 +341,7 @@ class CommentNonNodeTest extends BrowserTestBase { // Attempt to view comments while disallowed. $this->drupalGet('entity-test/' . $this->entity->id()); - $this->assertNoPattern('@]*>Comments@', 'Comments were not displayed.'); + $this->assertSession()->responseNotMatches('@]*>Comments@', 'Comments were not displayed.'); $this->assertNoLink('Add new comment', 'Link to add comment was found.'); // Attempt to view test entity comment form while disallowed. @@ -373,7 +373,7 @@ class CommentNonNodeTest extends BrowserTestBase { 'view test entity' => TRUE, ]); $this->drupalGet('entity_test/' . $this->entity->id()); - $this->assertNoPattern('@]*>Comments@', 'Comments were not displayed.'); + $this->assertSession()->responseNotMatches('@]*>Comments@', 'Comments were not displayed.'); $this->assertFieldByName('subject[0][value]', '', 'Subject field found.'); $this->assertFieldByName('comment_body[0][value]', '', 'Comment field found.'); diff --git a/core/modules/comment/tests/src/Functional/CommentTitleTest.php b/core/modules/comment/tests/src/Functional/CommentTitleTest.php index 9cd7946895bf..d3c563aba2fb 100644 --- a/core/modules/comment/tests/src/Functional/CommentTitleTest.php +++ b/core/modules/comment/tests/src/Functional/CommentTitleTest.php @@ -42,7 +42,7 @@ class CommentTitleTest extends CommentTestBase { $regex .= '/s'; $this->assertPattern($regex, 'Comment is created successfully'); // Tests that markup is not generated for the comment without header. - $this->assertNoPattern('|]*>|', 'Comment title H3 element not found when title is an empty string.'); + $this->assertSession()->responseNotMatches('|]*>|', 'Comment title H3 element not found when title is an empty string.'); } /** diff --git a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php index ce924f426aab..99aa00d04b03 100644 --- a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php +++ b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php @@ -358,7 +358,7 @@ class ImageFieldDisplayTest extends ImageFieldTestBase { $this->drupalGet('node/' . $node->id()); // Verify that no image is displayed on the page by checking for the class // that would be used on the image field. - $this->assertNoPattern('
', 'No image displayed when no image is attached and no default image specified.'); + $this->assertSession()->responseNotMatches('
', 'No image displayed when no image is attached and no default image specified.'); $cache_tags_header = $this->drupalGetHeader('X-Drupal-Cache-Tags'); $this->assertTrue(!preg_match('/ image_style\:/', $cache_tags_header), 'No image style cache tag found.'); diff --git a/core/modules/page_cache/tests/src/Functional/PageCacheTest.php b/core/modules/page_cache/tests/src/Functional/PageCacheTest.php index 3e90d8eb2c08..0f8f14e2d01c 100644 --- a/core/modules/page_cache/tests/src/Functional/PageCacheTest.php +++ b/core/modules/page_cache/tests/src/Functional/PageCacheTest.php @@ -189,7 +189,7 @@ class PageCacheTest extends BrowserTestBase { // Fill the cache. $this->drupalGet(''); // Verify the page is not printed twice when the cache is cold. - $this->assertNoPattern('#assertSession()->responseNotMatches('#drupalGet(''); $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.'); @@ -213,7 +213,7 @@ class PageCacheTest extends BrowserTestBase { $this->drupalGet('', [], ['If-Modified-Since' => $last_modified, 'If-None-Match' => NULL]); // Verify the page is not printed twice when the cache is warm. - $this->assertNoPattern('#assertSession()->responseNotMatches('#assertResponse(200, 'Conditional request without If-None-Match returned 200 OK.'); $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.'); diff --git a/core/modules/statistics/tests/src/Functional/StatisticsLoggingTest.php b/core/modules/statistics/tests/src/Functional/StatisticsLoggingTest.php index ea87a7cd4466..7c4a9fe8971b 100644 --- a/core/modules/statistics/tests/src/Functional/StatisticsLoggingTest.php +++ b/core/modules/statistics/tests/src/Functional/StatisticsLoggingTest.php @@ -99,13 +99,13 @@ class StatisticsLoggingTest extends BrowserTestBase { // Verify that logging scripts are not found on a non-node page. $this->drupalGet('node'); $settings = $this->getDrupalSettings(); - $this->assertNoPattern($expected_library, 'Statistics library JS not found on node page.'); + $this->assertSession()->responseNotMatches($expected_library, 'Statistics library JS not found on node page.'); $this->assertFalse(isset($settings['statistics']), 'Statistics settings not found on node page.'); // Verify that logging scripts are not found on a non-existent node page. $this->drupalGet('node/9999'); $settings = $this->getDrupalSettings(); - $this->assertNoPattern($expected_library, 'Statistics library JS not found on non-existent node page.'); + $this->assertSession()->responseNotMatches($expected_library, 'Statistics library JS not found on non-existent node page.'); $this->assertFalse(isset($settings['statistics']), 'Statistics settings not found on node page.'); // Verify that logging scripts are found on a valid node page. diff --git a/core/modules/system/tests/src/Functional/Common/NoJavaScriptAnonymousTest.php b/core/modules/system/tests/src/Functional/Common/NoJavaScriptAnonymousTest.php index 2be4d79ad541..49c2edc81943 100644 --- a/core/modules/system/tests/src/Functional/Common/NoJavaScriptAnonymousTest.php +++ b/core/modules/system/tests/src/Functional/Common/NoJavaScriptAnonymousTest.php @@ -61,7 +61,7 @@ class NoJavaScriptAnonymousTest extends BrowserTestBase { // Ensure no other JavaScript file exists on the page, while ignoring the // HTML5 shiv. - $this->assertNoPattern('/(?assertSession()->responseNotMatches('/(?drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview'); - $this->assertNoPattern('|