From e33e4c71c4741bc836ff7a1efc3ab7fa2fb6d8f8 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Fri, 6 Aug 2021 11:12:32 +0100 Subject: [PATCH] Issue #3227060 by mondrake, daffie: Replace usages of AssertLegacyTrait::assertNoRaw, that is deprecated --- .../tests/src/Functional/AddFeedTest.php | 2 +- .../tests/src/Functional/BigPipeTest.php | 44 +++++++++---------- .../src/Functional/BlockAdminThemeTest.php | 4 +- .../block/tests/src/Functional/BlockTest.php | 4 +- .../tests/src/Functional/BlockUiTest.php | 4 +- .../tests/src/Functional/BlockXssTest.php | 22 +++++----- .../Functional/BlockContentCreationTest.php | 2 +- .../src/Functional/CKEditorLoadingTest.php | 4 +- .../src/Functional/ColorSafePreviewTest.php | 2 +- .../color/tests/src/Functional/ColorTest.php | 6 +-- .../src/Functional/CommentAnonymousTest.php | 2 +- .../src/Functional/CommentInterfaceTest.php | 2 +- .../src/Functional/CommentNonNodeTest.php | 2 +- .../tests/src/Functional/CommentRssTest.php | 2 +- .../src/Functional/ConfigEntityListTest.php | 4 +- .../src/Functional/ConfigExportUITest.php | 2 +- .../src/Functional/ConfigImportUITest.php | 18 ++++---- .../Functional/ConfigTranslationUiTest.php | 2 +- .../src/Functional/ContactPersonalTest.php | 2 +- .../ContentTranslationEnableTest.php | 2 +- .../ContentTranslationUITestBase.php | 2 +- .../src/Functional/DateTimeFieldTest.php | 2 +- .../src/Functional/DateRangeFieldTest.php | 8 ++-- .../dblog/tests/src/Functional/DbLogTest.php | 4 +- .../tests/src/Functional/EditorAdminTest.php | 2 +- .../Functional/EditorUploadImageScaleTest.php | 4 +- .../Functional/Boolean/BooleanFieldTest.php | 2 +- .../tests/src/Traits/FieldUiTestTrait.php | 2 +- .../src/Functional/FileFieldDisplayTest.php | 2 +- .../tests/src/Functional/FilterAdminTest.php | 6 +-- .../src/Functional/ImageFieldDisplayTest.php | 2 +- .../tests/src/Functional/LinkFieldTest.php | 2 +- .../tests/src/Functional/LocaleExportTest.php | 4 +- .../MediaSourceOEmbedVideoTest.php | 4 +- .../tests/src/Functional/MenuUiTest.php | 2 +- .../src/Functional/AssertButtonsTrait.php | 2 +- .../src/Functional/NodeAccessPagerTest.php | 4 +- .../tests/src/Functional/NodeTitleXSSTest.php | 6 +-- .../src/Functional/NodeTranslationUITest.php | 2 +- .../tests/src/Functional/PagePreviewTest.php | 2 +- .../Functional/Views/BulkFormAccessTest.php | 4 +- .../src/Functional/OptionsFieldUITest.php | 2 +- .../QuickEditLoadingTest.php | 16 +++---- .../src/Functional/SearchAdminThemeTest.php | 2 +- .../src/Functional/SearchCommentTest.php | 6 +-- .../Functional/SearchNodeDiacriticsTest.php | 4 +- .../Functional/SearchNodePunctuationTest.php | 4 +- .../tests/src/Functional/Batch/PageTest.php | 2 +- .../Entity/EntityListBuilderTest.php | 4 +- .../tests/src/Functional/Form/FormTest.php | 8 ++-- .../Functional/Menu/MenuLinkSecurityTest.php | 4 +- .../src/Functional/Module/UninstallTest.php | 2 +- .../Routing/RouterPermissionTest.php | 2 +- .../System/DefaultMobileMetaTagsTest.php | 2 +- .../Functional/System/ErrorHandlerTest.php | 10 ++--- .../src/Functional/System/PageTitleTest.php | 4 +- .../tests/src/Functional/System/ThemeTest.php | 12 ++--- .../Theme/EntityFilteringThemeTest.php | 2 +- .../taxonomy/tests/src/Functional/RssTest.php | 2 +- .../src/Functional/UpdateContribTest.php | 14 +++--- .../src/Functional/UpdateSemverTestBase.php | 2 +- .../tests/src/Functional/UserCreateTest.php | 2 +- .../tests/src/Functional/UserPictureTest.php | 2 +- .../src/Functional/Views/BulkFormTest.php | 2 +- .../Views/HandlerFilterUserNameTest.php | 4 +- .../src/Functional/Plugin/ExposedFormTest.php | 6 +-- .../src/Functional/Plugin/StyleTableTest.php | 4 +- .../src/Functional/ViewsEscapingTest.php | 2 +- .../src/Functional/DisplayAttachmentTest.php | 2 +- .../tests/src/Functional/DisplayFeedTest.php | 2 +- .../tests/src/Functional/DisplayTest.php | 12 ++--- .../src/Functional/ExposedFormUITest.php | 2 +- .../tests/src/Functional/FilterUITest.php | 4 +- .../tests/src/Functional/PreviewTest.php | 2 +- .../Installer/StandardInstallerTest.php | 2 +- .../Core/Assert/AssertLegacyTraitTest.php | 1 + .../Listeners/DeprecationListenerTrait.php | 1 - 77 files changed, 176 insertions(+), 178 deletions(-) diff --git a/core/modules/aggregator/tests/src/Functional/AddFeedTest.php b/core/modules/aggregator/tests/src/Functional/AddFeedTest.php index 5b19c3672710..5e5ac32d06b4 100644 --- a/core/modules/aggregator/tests/src/Functional/AddFeedTest.php +++ b/core/modules/aggregator/tests/src/Functional/AddFeedTest.php @@ -66,7 +66,7 @@ public function testFeedLabelEscaping() { $this->assertSession()->statusCodeEquals(200); $this->assertSession()->assertEscaped('Test feed title <script>alert(123);</script>'); - $this->assertNoRaw('Test feed title <script>alert(123);</script>'); + $this->assertSession()->responseNotContains('Test feed title <script>alert(123);</script>'); // Ensure the feed icon title is escaped. $this->assertStringContainsString('class="feed-icon"> Subscribe to Test feed title <script>alert(123);</script> feed</a>', str_replace(["\n", "\r"], '', $this->getSession()->getPage()->getContent())); diff --git a/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php b/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php index 2e3ccf723461..e4fbb201786b 100644 --- a/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php +++ b/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php @@ -88,18 +88,18 @@ public function testNoJsDetection() { $this->drupalGet(Url::fromRoute('<front>')); $this->assertSessionCookieExists(FALSE); $this->assertBigPipeNoJsCookieExists(FALSE); - $this->assertNoRaw('<noscript><meta http-equiv="Refresh" content="0; URL='); - $this->assertNoRaw($no_js_to_js_markup); + $this->assertSession()->responseNotContains('<noscript><meta http-equiv="Refresh" content="0; URL='); + $this->assertSession()->responseNotContains($no_js_to_js_markup); // 2. Session (authenticated). $this->drupalLogin($this->rootUser); $this->assertSessionCookieExists(TRUE); $this->assertBigPipeNoJsCookieExists(FALSE); $this->assertRaw('<noscript><meta http-equiv="Refresh" content="0; URL=' . base_path() . 'big_pipe/no-js?destination=' . UrlHelper::encodePath(base_path() . 'user/1?check_logged_in=1') . '" />' . "\n" . '</noscript>'); - $this->assertNoRaw($no_js_to_js_markup); + $this->assertSession()->responseNotContains($no_js_to_js_markup); $this->assertBigPipeNoJsMetaRefreshRedirect(); $this->assertBigPipeNoJsCookieExists(TRUE); - $this->assertNoRaw('<noscript><meta http-equiv="Refresh" content="0; URL='); + $this->assertSession()->responseNotContains('<noscript><meta http-equiv="Refresh" content="0; URL='); $this->assertRaw($no_js_to_js_markup); $this->drupalLogout(); @@ -112,10 +112,10 @@ public function testNoJsDetection() { $this->assertSessionCookieExists(TRUE); $this->assertBigPipeNoJsCookieExists(FALSE); $this->assertRaw('<noscript><meta http-equiv="Refresh" content="0; URL=' . base_path() . 'big_pipe/no-js?destination=' . base_path() . 'user/login" />' . "\n" . '</noscript>'); - $this->assertNoRaw($no_js_to_js_markup); + $this->assertSession()->responseNotContains($no_js_to_js_markup); $this->assertBigPipeNoJsMetaRefreshRedirect(); $this->assertBigPipeNoJsCookieExists(TRUE); - $this->assertNoRaw('<noscript><meta http-equiv="Refresh" content="0; URL='); + $this->assertSession()->responseNotContains('<noscript><meta http-equiv="Refresh" content="0; URL='); $this->assertRaw($no_js_to_js_markup); // Close the prior connection and remove the collected state. @@ -125,14 +125,14 @@ public function testNoJsDetection() { $this->drupalGet(Url::fromRoute('no_big_pipe')); $this->assertSessionCookieExists(FALSE); $this->assertBigPipeNoJsCookieExists(FALSE); - $this->assertNoRaw('<noscript><meta http-equiv="Refresh" content="0; URL='); - $this->assertNoRaw($no_js_to_js_markup); + $this->assertSession()->responseNotContains('<noscript><meta http-equiv="Refresh" content="0; URL='); + $this->assertSession()->responseNotContains($no_js_to_js_markup); $this->drupalLogin($this->rootUser); $this->drupalGet(Url::fromRoute('no_big_pipe')); $this->assertSessionCookieExists(TRUE); $this->assertBigPipeNoJsCookieExists(FALSE); - $this->assertNoRaw('<noscript><meta http-equiv="Refresh" content="0; URL='); - $this->assertNoRaw($no_js_to_js_markup); + $this->assertSession()->responseNotContains('<noscript><meta http-equiv="Refresh" content="0; URL='); + $this->assertSession()->responseNotContains($no_js_to_js_markup); } /** @@ -215,8 +215,8 @@ public function testBigPipe() { $this->assertRaw('The website encountered an unexpected error. Please try again later'); $this->assertRaw('You are not allowed to say llamas are not cool!'); // Check that stop signal and closing body tag are absent. - $this->assertNoRaw(BigPipe::STOP_SIGNAL); - $this->assertNoRaw('</body>'); + $this->assertSession()->responseNotContains(BigPipe::STOP_SIGNAL); + $this->assertSession()->responseNotContains('</body>'); // The exception is expected. Do not interpret it as a test failure. unlink($this->root . '/' . $this->siteDirectory . '/error.log'); } @@ -266,8 +266,8 @@ public function testBigPipeNoJs() { // Verifying there are no BigPipe placeholders & replacements. $this->assertSession()->responseHeaderEquals('BigPipe-Test-Placeholders', '<none>'); // Verifying BigPipe start/stop signals are absent. - $this->assertNoRaw(BigPipe::START_SIGNAL); - $this->assertNoRaw(BigPipe::STOP_SIGNAL); + $this->assertSession()->responseNotContains(BigPipe::START_SIGNAL); + $this->assertSession()->responseNotContains(BigPipe::STOP_SIGNAL); // Verifying BigPipe assets are absent. $this->assertArrayNotHasKey('bigPipePlaceholderIds', $this->getDrupalSettings()); @@ -286,7 +286,7 @@ public function testBigPipeNoJs() { // The 'edge_case__html_exception' case throws an exception. $this->assertRaw('The website encountered an unexpected error. Please try again later'); $this->assertRaw('You are not allowed to say llamas are not cool!'); - $this->assertNoRaw('</body>'); + $this->assertSession()->responseNotContains('</body>'); // The exception is expected. Do not interpret it as a test failure. unlink($this->root . '/' . $this->siteDirectory . '/error.log'); } @@ -309,8 +309,8 @@ public function testBigPipeMultiOccurrencePlaceholders() { $big_pipe_placeholder_id = 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args%5B0%5D&token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA'; $expected_placeholder_replacement = '<script type="application/vnd.drupal-ajax" data-big-pipe-replacement-for-placeholder-with-id="' . $big_pipe_placeholder_id . '">'; $this->assertRaw('The count is 1.'); - $this->assertNoRaw('The count is 2.'); - $this->assertNoRaw('The count is 3.'); + $this->assertSession()->responseNotContains('The count is 2.'); + $this->assertSession()->responseNotContains('The count is 3.'); $raw_content = $this->getSession()->getPage()->getContent(); $this->assertSame(1, substr_count($raw_content, $expected_placeholder_replacement), 'Only one placeholder replacement was found for the duplicate #lazy_builder arrays.'); @@ -323,8 +323,8 @@ public function testBigPipeMultiOccurrencePlaceholders() { $this->assertBigPipeNoJsCookieExists(TRUE); $this->drupalGet(Url::fromRoute('big_pipe_test_multi_occurrence')); $this->assertRaw('The count is 1.'); - $this->assertNoRaw('The count is 2.'); - $this->assertNoRaw('The count is 3.'); + $this->assertSession()->responseNotContains('The count is 2.'); + $this->assertSession()->responseNotContains('The count is 3.'); } protected function assertBigPipeResponseHeadersPresent() { @@ -346,7 +346,7 @@ protected function assertBigPipeNoJsPlaceholders(array $expected_big_pipe_nojs_p foreach ($expected_big_pipe_nojs_placeholders as $big_pipe_nojs_placeholder => $expected_replacement) { // Checking whether the replacement for the BigPipe no-JS placeholder // $big_pipe_nojs_placeholder is present. - $this->assertNoRaw($big_pipe_nojs_placeholder); + $this->assertSession()->responseNotContains($big_pipe_nojs_placeholder); if ($expected_replacement !== NULL) { $this->assertRaw($expected_replacement); } @@ -377,7 +377,7 @@ protected function assertBigPipePlaceholders(array $expected_big_pipe_placeholde $result = $this->xpath('//script[@data-big-pipe-replacement-for-placeholder-with-id=:id]', [':id' => Html::decodeEntities($big_pipe_placeholder_id)]); if ($expected_ajax_response === NULL) { $this->assertCount(0, $result); - $this->assertNoRaw($expected_placeholder_replacement); + $this->assertSession()->responseNotContains($expected_placeholder_replacement); continue; } $this->assertEquals($expected_ajax_response, trim($result[0]->getText())); @@ -495,7 +495,7 @@ protected function assertBigPipeNoJsMetaRefreshRedirect() { $this->assertEquals('no-store, content="BigPipe/1.0"', $headers[1]['Surrogate-Control'][0], 'The second response has a "Surrogate-Control" header.'); // Check that the <meta> refresh is absent, only one redirect ever happens. - $this->assertNoRaw('<noscript><meta http-equiv="Refresh" content="0; URL='); + $this->assertSession()->responseNotContains('<noscript><meta http-equiv="Refresh" content="0; URL='); } } diff --git a/core/modules/block/tests/src/Functional/BlockAdminThemeTest.php b/core/modules/block/tests/src/Functional/BlockAdminThemeTest.php index 1bae75e734ae..187cacf3a606 100644 --- a/core/modules/block/tests/src/Functional/BlockAdminThemeTest.php +++ b/core/modules/block/tests/src/Functional/BlockAdminThemeTest.php @@ -80,8 +80,8 @@ public function testSevenAdminTheme() { $this->drupalGet('admin'); // Check if contextual link classes are unavailable. - $this->assertNoRaw('<div data-contextual-id="block:block=' . $block->id() . ':langcode=en"></div>'); - $this->assertNoRaw('contextual-region'); + $this->assertSession()->responseNotContains('<div data-contextual-id="block:block=' . $block->id() . ':langcode=en"></div>'); + $this->assertSession()->responseNotContains('contextual-region'); } } diff --git a/core/modules/block/tests/src/Functional/BlockTest.php b/core/modules/block/tests/src/Functional/BlockTest.php index 1663175b1bcd..8bd22cb96b2f 100644 --- a/core/modules/block/tests/src/Functional/BlockTest.php +++ b/core/modules/block/tests/src/Functional/BlockTest.php @@ -65,7 +65,7 @@ public function testBlockVisibility() { // Confirm that an empty block is not displayed. $this->assertSession()->pageTextNotContains('Powered by Drupal'); - $this->assertNoRaw('sidebar-first'); + $this->assertSession()->responseNotContains('sidebar-first'); } /** @@ -259,7 +259,7 @@ public function testBlock() { $this->submitForm([], 'Remove'); $this->assertSession()->pageTextContains('The block ' . $block->label() . ' has been removed from the Left sidebar region.'); $this->assertSession()->addressEquals('admin'); - $this->assertNoRaw($block->id()); + $this->assertSession()->responseNotContains($block->id()); } /** diff --git a/core/modules/block/tests/src/Functional/BlockUiTest.php b/core/modules/block/tests/src/Functional/BlockUiTest.php index a8d0b5c2982e..140821922bfc 100644 --- a/core/modules/block/tests/src/Functional/BlockUiTest.php +++ b/core/modules/block/tests/src/Functional/BlockUiTest.php @@ -217,7 +217,7 @@ public function testContextAwareBlocks() { $expected_text = '<div id="test_context_aware--username">' . \Drupal::currentUser()->getAccountName() . '</div>'; $this->drupalGet(''); $this->assertSession()->pageTextNotContains('Test context-aware block'); - $this->assertNoRaw($expected_text); + $this->assertSession()->responseNotContains($expected_text); $block_url = 'admin/structure/block/add/test_context_aware/classy'; $arguments = [ @@ -264,7 +264,7 @@ public function testContextAwareBlocks() { // Tests that conditions with missing context are not displayed. $this->drupalGet('admin/structure/block/manage/testcontextawareblock'); - $this->assertNoRaw('No existing type'); + $this->assertSession()->responseNotContains('No existing type'); $this->assertSession()->elementNotExists('xpath', '//*[@name="visibility[condition_test_no_existing_type][negate]"]'); } diff --git a/core/modules/block/tests/src/Functional/BlockXssTest.php b/core/modules/block/tests/src/Functional/BlockXssTest.php index ed422a9f5af3..069d189b2ba2 100644 --- a/core/modules/block/tests/src/Functional/BlockXssTest.php +++ b/core/modules/block/tests/src/Functional/BlockXssTest.php @@ -51,7 +51,7 @@ public function testXssInTitle() { \Drupal::state()->set('block_test.content', $this->randomMachineName()); $this->drupalGet(''); // Check that the block title was properly sanitized when rendered. - $this->assertNoRaw('<script>alert("XSS label");</script>'); + $this->assertSession()->responseNotContains('<script>alert("XSS label");</script>'); $this->drupalLogin($this->drupalCreateUser([ 'administer blocks', @@ -61,7 +61,7 @@ public function testXssInTitle() { $this->drupalGet('admin/structure/block/list/' . $default_theme); // Check that the block title was properly sanitized in Block Plugin UI // Admin page. - $this->assertNoRaw("<script>alert('XSS subject');</script>"); + $this->assertSession()->responseNotContains("<script>alert('XSS subject');</script>"); } /** @@ -76,7 +76,7 @@ public function testXssInCategory() { ])); $this->drupalGet(Url::fromRoute('block.admin_display')); $this->clickLink('Place block'); - $this->assertNoRaw("<script>alert('XSS category');</script>"); + $this->assertSession()->responseNotContains("<script>alert('XSS category');</script>"); } /** @@ -92,7 +92,7 @@ public function testBlockXss() { $this->drupalGet(Url::fromRoute('block.admin_display')); $this->clickLink('Place block'); // Check that the page does not have double escaped HTML tags. - $this->assertNoRaw('&lt;'); + $this->assertSession()->responseNotContains('&lt;'); } /** @@ -135,14 +135,14 @@ protected function doViewTest() { // Assert that the blocks have their admin labels escaped and // don't appear anywhere unescaped. $this->assertSession()->assertEscaped('<script>alert("view1");</script>'); - $this->assertNoRaw('<script>alert("view1");</script>'); + $this->assertSession()->responseNotContains('<script>alert("view1");</script>'); $this->assertSession()->assertEscaped('<script>alert("view2");</script>: Fish & chips'); - $this->assertNoRaw('<script>alert("view2");</script>'); - $this->assertNoRaw('Fish & chips'); + $this->assertSession()->responseNotContains('<script>alert("view2");</script>'); + $this->assertSession()->responseNotContains('Fish & chips'); // Assert the Display label doesn't appear anywhere double escaped. - $this->assertNoRaw('Fish & chips'); - $this->assertNoRaw('Fish &amp; chips'); + $this->assertSession()->responseNotContains('Fish & chips'); + $this->assertSession()->responseNotContains('Fish &amp; chips'); } /** @@ -158,7 +158,7 @@ protected function doMenuTest() { $this->clickLink('Place block'); $this->assertSession()->assertEscaped('<script>alert("menu");</script>'); - $this->assertNoRaw('<script>alert("menu");</script>'); + $this->assertSession()->responseNotContains('<script>alert("menu");</script>'); } /** @@ -179,7 +179,7 @@ protected function doBlockContentTest() { $this->clickLink('Place block'); $this->assertSession()->assertEscaped('<script>alert("block_content");</script>'); - $this->assertNoRaw('<script>alert("block_content");</script>'); + $this->assertSession()->responseNotContains('<script>alert("block_content");</script>'); } } diff --git a/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php index 913c1ac10160..f9f0284efb1b 100644 --- a/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php +++ b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php @@ -258,7 +258,7 @@ public function testBlockDelete() { $this->drupalGet('block/add/basic'); $this->submitForm($edit2, 'Save'); - $this->assertNoRaw('Error message'); + $this->assertSession()->responseNotContains('Error message'); // Create another block with no instances, and test we don't get a // confirmation message about deleting instances. diff --git a/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php b/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php index fec5083a088b..e485efe98d6a 100644 --- a/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php +++ b/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php @@ -101,11 +101,11 @@ public function testLoading() { // Verify that a single text format hidden input does not exist on the page. $this->assertSession()->elementNotExists('xpath', '//input[@type="hidden" and contains(@class, "editor")]'); // Verify that CKEditor glue JS is absent. - $this->assertNoRaw($this->getModulePath('ckeditor') . '/js/ckeditor.js'); + $this->assertSession()->responseNotContains($this->getModulePath('ckeditor') . '/js/ckeditor.js'); // On pages where there would never be a text editor, CKEditor JS is absent. $this->drupalGet('user'); - $this->assertNoRaw($this->getModulePath('ckeditor') . '/js/ckeditor.js'); + $this->assertSession()->responseNotContains($this->getModulePath('ckeditor') . '/js/ckeditor.js'); // The normal user: // - has access to 2 text formats; diff --git a/core/modules/color/tests/src/Functional/ColorSafePreviewTest.php b/core/modules/color/tests/src/Functional/ColorSafePreviewTest.php index e7ae43df048f..7520cb5a5282 100644 --- a/core/modules/color/tests/src/Functional/ColorSafePreviewTest.php +++ b/core/modules/color/tests/src/Functional/ColorSafePreviewTest.php @@ -55,7 +55,7 @@ public function testColorPreview() { $this->drupalGet($url); $this->assertSession()->pageTextContains('TEST COLOR PREVIEW'); - $this->assertNoRaw('<script>alert("security filter test");</script>'); + $this->assertSession()->responseNotContains('<script>alert("security filter test");</script>'); $this->assertRaw('<h2>TEST COLOR PREVIEW</h2>'); } diff --git a/core/modules/color/tests/src/Functional/ColorTest.php b/core/modules/color/tests/src/Functional/ColorTest.php index e2072edb2838..d919d17eaa5d 100644 --- a/core/modules/color/tests/src/Functional/ColorTest.php +++ b/core/modules/color/tests/src/Functional/ColorTest.php @@ -215,7 +215,7 @@ public function testOverrideAndResetScheme() { $this->drupalGet(''); // Make sure the color logo is not being used. - $this->assertNoRaw('files/color/bartik-'); + $this->assertSession()->responseNotContains('files/color/bartik-'); // Make sure the original bartik logo exists. $this->assertRaw('bartik/logo.svg'); @@ -231,7 +231,7 @@ public function testOverrideAndResetScheme() { // Make sure the color logo is being used. $this->assertRaw('files/color/bartik-'); // Make sure the original bartik logo does not exist. - $this->assertNoRaw('bartik/logo.svg'); + $this->assertSession()->responseNotContains('bartik/logo.svg'); // Log in and set the color scheme back to default (delete config). $this->drupalLogin($this->bigUser); @@ -243,7 +243,7 @@ public function testOverrideAndResetScheme() { $this->drupalLogout(); $this->drupalGet(''); // Make sure the color logo is not being used. - $this->assertNoRaw('files/color/bartik-'); + $this->assertSession()->responseNotContains('files/color/bartik-'); // Make sure the original bartik logo exists. $this->assertRaw('bartik/logo.svg'); } diff --git a/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php b/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php index b197181aaf3a..d9ae7a1a5241 100644 --- a/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php +++ b/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php @@ -158,7 +158,7 @@ public function testAnonymous() { $this->performCommentOperation($anonymous_comment3, 'delete'); $this->drupalGet('admin/content/comment'); - $this->assertNoRaw('comments[' . $anonymous_comment3->id() . ']'); + $this->assertSession()->responseNotContains('comments[' . $anonymous_comment3->id() . ']'); $this->drupalLogout(); // Comment 3 was deleted. diff --git a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php index ceb2108c1334..7a0b96dccad8 100644 --- a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php +++ b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php @@ -351,7 +351,7 @@ public function testViewMode() { // mode this time. $comment_element = $this->cssSelect('.comment-wrapper'); $this->assertTrue(!empty($comment_element)); - $this->assertNoRaw('<p>' . $comment_text . '</p>'); + $this->assertSession()->responseNotContains('<p>' . $comment_text . '</p>'); } } diff --git a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php index 8b8d78d7b3ca..255a51d8d90c 100644 --- a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php +++ b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php @@ -324,7 +324,7 @@ public function testCommentFunctionality() { // Delete the comment. $this->performCommentOperation($comment1, 'delete'); $this->drupalGet('admin/content/comment'); - $this->assertNoRaw('comments[' . $comment1->id() . ']'); + $this->assertSession()->responseNotContains('comments[' . $comment1->id() . ']'); // Post another comment. $comment1 = $this->postComment($this->entity, $this->randomMachineName(), $this->randomMachineName()); diff --git a/core/modules/comment/tests/src/Functional/CommentRssTest.php b/core/modules/comment/tests/src/Functional/CommentRssTest.php index 0ea4351205ae..611a636d6103 100644 --- a/core/modules/comment/tests/src/Functional/CommentRssTest.php +++ b/core/modules/comment/tests/src/Functional/CommentRssTest.php @@ -78,7 +78,7 @@ public function testCommentRss() { $this->node->set('comment', CommentItemInterface::HIDDEN); $this->node->save(); $this->drupalGet('rss.xml'); - $this->assertNoRaw($raw); + $this->assertSession()->responseNotContains($raw); } } diff --git a/core/modules/config/tests/src/Functional/ConfigEntityListTest.php b/core/modules/config/tests/src/Functional/ConfigEntityListTest.php index 7a1525b1b2af..1a96f247f6d0 100644 --- a/core/modules/config/tests/src/Functional/ConfigEntityListTest.php +++ b/core/modules/config/tests/src/Functional/ConfigEntityListTest.php @@ -274,11 +274,11 @@ public function testPager() { // Item 51 should not be present. $this->assertRaw('Test config entity 50'); - $this->assertNoRaw('Test config entity 51'); + $this->assertSession()->responseNotContains('Test config entity 51'); // Browse to the next page, test config entity 51 is on page 2. $this->clickLink('Page 2'); - $this->assertNoRaw('Test config entity 50'); + $this->assertSession()->responseNotContains('Test config entity 50'); $this->assertRaw('dotted.default'); $this->assertRaw('Test config entity 51'); } diff --git a/core/modules/config/tests/src/Functional/ConfigExportUITest.php b/core/modules/config/tests/src/Functional/ConfigExportUITest.php index bb711bb996e3..95d6ebdc0f32 100644 --- a/core/modules/config/tests/src/Functional/ConfigExportUITest.php +++ b/core/modules/config/tests/src/Functional/ConfigExportUITest.php @@ -90,7 +90,7 @@ public function testExport() { // Check the single export form doesn't have "form-required" elements. $this->drupalGet('admin/config/development/configuration/single/export'); - $this->assertNoRaw('js-form-required form-required'); + $this->assertSession()->responseNotContains('js-form-required form-required'); // Ensure the temporary file is not available to users without the // permission. diff --git a/core/modules/config/tests/src/Functional/ConfigImportUITest.php b/core/modules/config/tests/src/Functional/ConfigImportUITest.php index 5c653b74d3c0..22d4b909c74b 100644 --- a/core/modules/config/tests/src/Functional/ConfigImportUITest.php +++ b/core/modules/config/tests/src/Functional/ConfigImportUITest.php @@ -128,11 +128,11 @@ public function testImport() { // Import and verify that both do not appear anymore. $this->submitForm([], 'Import all'); - $this->assertNoRaw('<td>' . $name); - $this->assertNoRaw('<td>' . $dynamic_name); - $this->assertNoRaw('<td>core.extension'); - $this->assertNoRaw('<td>system.theme'); - $this->assertNoRaw('<td>automated_cron.settings'); + $this->assertSession()->responseNotContains('<td>' . $name); + $this->assertSession()->responseNotContains('<td>' . $dynamic_name); + $this->assertSession()->responseNotContains('<td>core.extension'); + $this->assertSession()->responseNotContains('<td>system.theme'); + $this->assertSession()->responseNotContains('<td>automated_cron.settings'); $this->assertSession()->buttonNotExists('Import all'); @@ -199,9 +199,9 @@ public function testImport() { // Import and verify that both do not appear anymore. $this->submitForm([], 'Import all'); - $this->assertNoRaw('<td>core.extension'); - $this->assertNoRaw('<td>system.theme'); - $this->assertNoRaw('<td>automated_cron.settings'); + $this->assertSession()->responseNotContains('<td>core.extension'); + $this->assertSession()->responseNotContains('<td>system.theme'); + $this->assertSession()->responseNotContains('<td>automated_cron.settings'); $this->rebuildContainer(); $this->assertFalse(\Drupal::moduleHandler()->moduleExists('ban'), 'Ban module uninstalled during import.'); @@ -298,7 +298,7 @@ public function testImportDiff() { // Load the diff UI and verify that the diff reflects the change. $this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name); - $this->assertNoRaw('&nbsp;'); + $this->assertSession()->responseNotContains('&nbsp;'); $this->assertSession()->titleEquals("View changes of $config_name | Drupal"); // The following assertions do not use diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php index 3fe24c72b47e..0fa289de80d7 100644 --- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php +++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php @@ -682,7 +682,7 @@ public function testPluralConfigStringsSourceElements() { $this->assertRaw('edit-source-config-names-viewsviewfiles-display-default-display-options-fields-count-format-plural-string-' . $index); } else { - $this->assertNoRaw('edit-source-config-names-viewsviewfiles-display-default-display-options-fields-count-format-plural-string-' . $index); + $this->assertSession()->responseNotContains('edit-source-config-names-viewsviewfiles-display-default-display-options-fields-count-format-plural-string-' . $index); } } } diff --git a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php index b91852918bd0..6340c5e24243 100644 --- a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php +++ b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php @@ -116,7 +116,7 @@ public function testSendPersonalContactMessage() { ]; $this->assertRaw(new FormattableMarkup('@sender_name (@sender_email) sent @recipient_name an email.', $placeholders)); // Ensure an unescaped version of the email does not exist anywhere. - $this->assertNoRaw($this->webUser->getEmail()); + $this->assertSession()->responseNotContains($this->webUser->getEmail()); // Test HTML mails. $mail_config = $this->config('system.mail'); diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationEnableTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationEnableTest.php index 3a301c9fa26c..800da5ec9f5b 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationEnableTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationEnableTest.php @@ -46,7 +46,7 @@ public function testEnable() { $this->drupalGet('admin/config/regional/content-language'); // The node entity type should not be an option because it has no bundles. - $this->assertNoRaw('entity_types[node]'); + $this->assertSession()->responseNotContains('entity_types[node]'); // Enable content translation on entity types that have will have a // content_translation_uid. $edit = [ diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php index c5f132bd2615..93486ebe2005 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php @@ -116,7 +116,7 @@ protected function doTestBasicTranslation() { // Assert that HTML is not escaped unexpectedly. if ($this->testHTMLEscapeForAllLanguages) { - $this->assertNoRaw('<span class="translation-entity-all-languages">(all languages)</span>'); + $this->assertSession()->responseNotContains('<span class="translation-entity-all-languages">(all languages)</span>'); $this->assertRaw('<span class="translation-entity-all-languages">(all languages)</span>'); } diff --git a/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php b/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php index 454574029c83..c4f5b021b2f1 100644 --- a/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php +++ b/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php @@ -79,7 +79,7 @@ public function testDateField() { $id = $match[1]; $this->assertSession()->pageTextContains('entity_test ' . $id . ' has been created.'); $this->assertRaw($date->format($date_format)); - $this->assertNoRaw($date->format($time_format)); + $this->assertSession()->responseNotContains($date->format($time_format)); // Verify the date doesn't change if using a timezone that is UTC+12 when // the entity is edited through the form. diff --git a/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php b/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php index 628a8200f135..3f65bdb0fc89 100644 --- a/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php +++ b/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php @@ -94,9 +94,9 @@ public function testDateRangeField() { $id = $match[1]; $this->assertSession()->pageTextContains('entity_test ' . $id . ' has been created.'); $this->assertRaw($start_date->format($date_format)); - $this->assertNoRaw($start_date->format($time_format)); + $this->assertSession()->responseNotContains($start_date->format($time_format)); $this->assertRaw($end_date->format($date_format)); - $this->assertNoRaw($end_date->format($time_format)); + $this->assertSession()->responseNotContains($end_date->format($time_format)); // Verify the date doesn't change when entity is edited through the form. $entity = EntityTest::load($id); @@ -500,9 +500,9 @@ public function testAlldayRangeField() { $id = $match[1]; $this->assertSession()->pageTextContains('entity_test ' . $id . ' has been created.'); $this->assertRaw($start_date->format($date_format)); - $this->assertNoRaw($start_date->format($time_format)); + $this->assertSession()->responseNotContains($start_date->format($time_format)); $this->assertRaw($end_date->format($date_format)); - $this->assertNoRaw($end_date->format($time_format)); + $this->assertSession()->responseNotContains($end_date->format($time_format)); /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ $display_repository = \Drupal::service('entity_display.repository'); diff --git a/core/modules/dblog/tests/src/Functional/DbLogTest.php b/core/modules/dblog/tests/src/Functional/DbLogTest.php index 1dda6e86bcda..95070c9a037a 100644 --- a/core/modules/dblog/tests/src/Functional/DbLogTest.php +++ b/core/modules/dblog/tests/src/Functional/DbLogTest.php @@ -851,7 +851,7 @@ public function testOverviewLinks() { $this->assertSession()->statusCodeEquals(200); // Make sure HTML tags are filtered out. $this->assertRaw('title="alert('foo');Lorem'); - $this->assertNoRaw("<script>alert('foo');</script>"); + $this->assertSession()->responseNotContains("<script>alert('foo');</script>"); // Make sure HTML tags are filtered out in admin/reports/dblog/event/ too. $this->generateLogEntries(1, ['message' => "<script>alert('foo');</script> <strong>Lorem ipsum</strong>"]); @@ -859,7 +859,7 @@ public function testOverviewLinks() { $query->addExpression('MAX([wid])'); $wid = $query->execute()->fetchField(); $this->drupalGet('admin/reports/dblog/event/' . $wid); - $this->assertNoRaw("<script>alert('foo');</script>"); + $this->assertSession()->responseNotContains("<script>alert('foo');</script>"); $this->assertRaw("alert('foo'); <strong>Lorem ipsum</strong>"); } diff --git a/core/modules/editor/tests/src/Functional/EditorAdminTest.php b/core/modules/editor/tests/src/Functional/EditorAdminTest.php index be112b1279d1..4aa07e332004 100644 --- a/core/modules/editor/tests/src/Functional/EditorAdminTest.php +++ b/core/modules/editor/tests/src/Functional/EditorAdminTest.php @@ -216,7 +216,7 @@ protected function selectUnicornEditor() { $this->assertSame('Unicorn Editor', $options[1]->getText(), 'Option 2 in the Text Editor select is "Unicorn Editor".'); $this->assertTrue($options[0]->hasAttribute('selected'), 'Option 1 ("None") is selected.'); // Ensure the none option is selected. - $this->assertNoRaw('This option is disabled because no modules that provide a text editor are currently enabled.'); + $this->assertSession()->pageTextNotContains('This option is disabled because no modules that provide a text editor are currently enabled.'); // Select the "Unicorn Editor" editor and click the "Configure" button. $edit = [ diff --git a/core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php b/core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php index fd347167b8ec..bc768e1327b5 100644 --- a/core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php +++ b/core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php @@ -90,7 +90,7 @@ public function testEditorUploadImageScale() { list($uploaded_image_file_width, $uploaded_image_file_height) = $this->uploadImage($test_image->uri); $this->assertEquals($image_file_width, $uploaded_image_file_width); $this->assertEquals($image_file_height, $uploaded_image_file_height); - $this->assertNoRaw((string) new FormattableMarkup('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', ['%dimensions' => $max_width . 'x' . $max_height])); + $this->assertSession()->pageTextNotContains("The image was resized to fit within the maximum allowed dimensions of {$max_width}x{$max_height} pixels."); // Case 2: max width smaller than uploaded image: image scaled down. $test_image = $testing_image_list[1]; @@ -126,7 +126,7 @@ public function testEditorUploadImageScale() { list($uploaded_image_file_width, $uploaded_image_file_height) = $this->uploadImage($test_image->uri); $this->assertEquals($image_file_width, $uploaded_image_file_width); $this->assertEquals($image_file_height, $uploaded_image_file_height); - $this->assertNoRaw((string) new FormattableMarkup('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', ['%dimensions' => $max_width . 'x' . $max_height])); + $this->assertSession()->pageTextNotContains("The image was resized to fit within the maximum allowed dimensions of {$max_width}x{$max_height} pixels."); // Case 5: only max width dimension was provided and it was smaller than // uploaded image: image scaled down. diff --git a/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php b/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php index ef4efa877429..fb431349b859 100644 --- a/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php +++ b/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php @@ -108,7 +108,7 @@ public function testBooleanField() { $this->drupalGet('entity_test/add'); $this->assertSession()->fieldValueEquals("{$field_name}[value]", ''); $this->assertSession()->pageTextContains($this->field->label()); - $this->assertNoRaw($on); + $this->assertSession()->responseNotContains($on); // Submit and ensure it is accepted. $edit = [ diff --git a/core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php b/core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php index bd7f0739456f..d1e4ee39de28 100644 --- a/core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php +++ b/core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php @@ -95,7 +95,7 @@ public function fieldUIAddExistingField($bundle_path, $existing_storage_name, $l // contain HTML which will be auto-escaped by Twig. $this->assertRaw('field-config-edit-form'); // Check that the page does not have double escaped HTML tags. - $this->assertNoRaw('&lt;'); + $this->assertSession()->responseNotContains('&lt;'); // Second step: 'Field settings' form. $this->submitForm($field_edit, 'Save settings'); diff --git a/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php b/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php index 4299fff0410e..6628e2b663a8 100644 --- a/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php +++ b/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php @@ -87,7 +87,7 @@ public function testNodeDisplay() { $this->drupalGet('node/' . $nid . '/edit'); $this->submitForm($edit, 'Save'); - $this->assertNoRaw($default_output); + $this->assertSession()->responseNotContains($default_output); // Add a description and make sure that it is displayed. $description = $this->randomMachineName(); diff --git a/core/modules/filter/tests/src/Functional/FilterAdminTest.php b/core/modules/filter/tests/src/Functional/FilterAdminTest.php index d5bf2d8acad4..b4a2bce29c56 100644 --- a/core/modules/filter/tests/src/Functional/FilterAdminTest.php +++ b/core/modules/filter/tests/src/Functional/FilterAdminTest.php @@ -206,7 +206,7 @@ public function testFilterAdmin() { // Check that the fallback format exists and cannot be disabled. $this->assertSame($plain, filter_fallback_format(), 'The fallback format is set to plain text.'); $this->drupalGet('admin/config/content/formats'); - $this->assertNoRaw('admin/config/content/formats/manage/' . $plain . '/disable'); + $this->assertSession()->responseNotContains('admin/config/content/formats/manage/' . $plain . '/disable'); $this->drupalGet('admin/config/content/formats/manage/' . $plain . '/disable'); $this->assertSession()->statusCodeEquals(403); @@ -457,7 +457,7 @@ public function testDisabledFormat() { // The format is not used anymore. $this->assertSession()->pageTextNotContains('filtered text'); // The text is not displayed unfiltered or escaped. - $this->assertNoRaw($body_value); + $this->assertSession()->responseNotContains($body_value); $this->assertSession()->assertNoEscaped($body_value); // Visit the dblog report page. @@ -473,7 +473,7 @@ public function testDisabledFormat() { $node->save(); $this->drupalGet($node->toUrl()); // The text is not displayed unfiltered or escaped. - $this->assertNoRaw($body_value); + $this->assertSession()->responseNotContains($body_value); $this->assertSession()->assertNoEscaped($body_value); // Visit the dblog report page. diff --git a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php index 185f4f4e56d0..f76f6fcfb552 100644 --- a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php +++ b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php @@ -429,7 +429,7 @@ public function testImageFieldDefaultImage() { // Verify that no image style cache tags are found. $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'image_style:'); // Default image should not be displayed. - $this->assertNoRaw($default_output); + $this->assertSession()->responseNotContains($default_output); // User supplied image should be displayed. $this->assertRaw($image_output); diff --git a/core/modules/link/tests/src/Functional/LinkFieldTest.php b/core/modules/link/tests/src/Functional/LinkFieldTest.php index c6712dbec0c3..22b03b0c08e5 100644 --- a/core/modules/link/tests/src/Functional/LinkFieldTest.php +++ b/core/modules/link/tests/src/Functional/LinkFieldTest.php @@ -300,7 +300,7 @@ public function testLinkTitle() { if ($title_setting === DRUPAL_DISABLED) { $this->assertSession()->fieldNotExists("{$field_name}[0][title]"); - $this->assertNoRaw('placeholder="Enter the text for this link"'); + $this->assertSession()->responseNotContains('placeholder="Enter the text for this link"'); } else { $this->assertRaw('placeholder="Enter the text for this link"'); diff --git a/core/modules/locale/tests/src/Functional/LocaleExportTest.php b/core/modules/locale/tests/src/Functional/LocaleExportTest.php index d336289c517e..4a6a99114684 100644 --- a/core/modules/locale/tests/src/Functional/LocaleExportTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleExportTest.php @@ -104,7 +104,7 @@ public function testExportTranslation() { // Ensure the customized translations exist in the file. $this->assertRaw('msgstr "janvier"'); // Ensure no untranslated strings exist in the file. - $this->assertNoRaw('msgid "February"'); + $this->assertSession()->responseNotContains('msgid "February"'); // Export only untranslated French translations. $this->drupalGet('admin/config/regional/translate/export'); @@ -118,7 +118,7 @@ public function testExportTranslation() { // Ensure we have a translation file. $this->assertRaw('# French translation of Drupal'); // Ensure no customized translations exist in the file. - $this->assertNoRaw('msgstr "janvier"'); + $this->assertSession()->responseNotContains('msgstr "janvier"'); // Ensure the untranslated strings exist in the file, and with right quotes. $this->assertRaw($this->getUntranslatedString()); } diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php index a1dbe6e8b153..c40a11863bd6 100644 --- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php +++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php @@ -202,14 +202,14 @@ public function testMediaOEmbedVideoSource() { $this->drupalGet('media/oembed', ['query' => $query]); $assert_session->pageTextContains('By the power of Grayskull, Vimeo works!'); $this->assertRaw('core/themes/stable/templates/content/media-oembed-iframe.html.twig'); - $this->assertNoRaw('core/modules/media/templates/media-oembed-iframe.html.twig'); + $this->assertSession()->responseNotContains('core/modules/media/templates/media-oembed-iframe.html.twig'); // Test themes not inheriting from stable. \Drupal::service('theme_installer')->install(['stark']); $this->config('system.theme')->set('default', 'stark')->save(); $this->drupalGet('media/oembed', ['query' => $query]); $assert_session->pageTextContains('By the power of Grayskull, Vimeo works!'); - $this->assertNoRaw('core/themes/stable/templates/content/media-oembed-iframe.html.twig'); + $this->assertSession()->responseNotContains('core/themes/stable/templates/content/media-oembed-iframe.html.twig'); $this->assertRaw('core/modules/media/templates/media-oembed-iframe.html.twig'); // Remove the 'view media' permission to test that this restricts access. diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php index 6b5d5123da40..fd9d1328c5ea 100644 --- a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php +++ b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php @@ -268,7 +268,7 @@ public function deleteCustomMenu() { // Make sure there's no delete button on system menus. $this->drupalGet('admin/structure/menu/manage/main'); - $this->assertNoRaw('edit-delete'); + $this->assertSession()->responseNotContains('edit-delete'); // Try to delete the main menu. $this->drupalGet('admin/structure/menu/manage/main/delete'); diff --git a/core/modules/node/tests/src/Functional/AssertButtonsTrait.php b/core/modules/node/tests/src/Functional/AssertButtonsTrait.php index 42cbb0eaa70a..1be59672f328 100644 --- a/core/modules/node/tests/src/Functional/AssertButtonsTrait.php +++ b/core/modules/node/tests/src/Functional/AssertButtonsTrait.php @@ -35,7 +35,7 @@ public function assertButtons(array $buttons, $dropbutton = TRUE) { else { // Assert there is a save button. $this->assertSession()->buttonExists('Save'); - $this->assertNoRaw('dropbutton-wrapper'); + $this->assertSession()->responseNotContains('dropbutton-wrapper'); } } diff --git a/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php b/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php index f7d3689de4ec..be68b22395c0 100644 --- a/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php +++ b/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php @@ -71,7 +71,7 @@ public function testCommentPager() { $this->assertSession()->pageTextContains($node->label()); $this->assertSession()->pageTextContains('Comments'); $this->assertRaw('page=1'); - $this->assertNoRaw('page=2'); + $this->assertSession()->responseNotContains('page=2'); } /** @@ -103,7 +103,7 @@ public function testForumPager() { $this->drupalLogin($this->webUser); $this->drupalGet('forum/' . $tid); $this->assertRaw('page=1'); - $this->assertNoRaw('page=2'); + $this->assertSession()->responseNotContains('page=2'); } } diff --git a/core/modules/node/tests/src/Functional/NodeTitleXSSTest.php b/core/modules/node/tests/src/Functional/NodeTitleXSSTest.php index ac5d8fc85093..10cbb14c5ef0 100644 --- a/core/modules/node/tests/src/Functional/NodeTitleXSSTest.php +++ b/core/modules/node/tests/src/Functional/NodeTitleXSSTest.php @@ -36,7 +36,7 @@ public function testNodeTitleXSS() { $this->drupalGet('node/add/page'); $this->submitForm($edit, 'Preview'); // Verify that harmful tags are escaped when previewing a node. - $this->assertNoRaw($xss); + $this->assertSession()->responseNotContains($xss); $settings = ['title' => $title]; $node = $this->drupalCreateNode($settings); @@ -44,10 +44,10 @@ public function testNodeTitleXSS() { $this->drupalGet('node/' . $node->id()); // Titles should be escaped. $this->assertRaw('<title>' . Html::escape($title) . ' | Drupal</title>'); - $this->assertNoRaw($xss); + $this->assertSession()->responseNotContains($xss); $this->drupalGet('node/' . $node->id() . '/edit'); - $this->assertNoRaw($xss); + $this->assertSession()->responseNotContains($xss); } } diff --git a/core/modules/node/tests/src/Functional/NodeTranslationUITest.php b/core/modules/node/tests/src/Functional/NodeTranslationUITest.php index ac02282f1b2b..e909f5db69ec 100644 --- a/core/modules/node/tests/src/Functional/NodeTranslationUITest.php +++ b/core/modules/node/tests/src/Functional/NodeTranslationUITest.php @@ -269,7 +269,7 @@ public function testTranslationLinkTheme() { $this->submitForm($edit, 'Save configuration'); $this->drupalGet('node/' . $article->id() . '/translations'); // Verify that translation uses the frontend theme if edit is frontend. - $this->assertNoRaw('core/themes/seven/css/base/elements.css'); + $this->assertSession()->responseNotContains('core/themes/seven/css/base/elements.css'); // Assert presence of translation page itself (vs. DisabledBundle below). $this->assertSession()->statusCodeEquals(200); diff --git a/core/modules/node/tests/src/Functional/PagePreviewTest.php b/core/modules/node/tests/src/Functional/PagePreviewTest.php index 01275ec02110..a9f22eed41e7 100644 --- a/core/modules/node/tests/src/Functional/PagePreviewTest.php +++ b/core/modules/node/tests/src/Functional/PagePreviewTest.php @@ -326,7 +326,7 @@ public function testPagePreview() { $node_type->setPreviewMode(DRUPAL_REQUIRED); $node_type->save(); $this->drupalGet('node/add/page'); - $this->assertNoRaw('edit-submit'); + $this->assertSession()->responseNotContains('edit-submit'); $this->drupalGet('node/add/page'); $this->submitForm([$title_key => 'Preview'], 'Preview'); $this->clickLink('Back to content editing'); diff --git a/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php b/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php index 2f614ee603b0..aff2832b5fe5 100644 --- a/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php +++ b/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php @@ -124,9 +124,7 @@ public function testNodeEditAccess() { $this->drupalGet('test-node-bulk-form'); $this->submitForm($edit, 'Apply to selected items'); // Test that the action message isn't shown. - $this->assertNoRaw(new FormattableMarkup('%action was applied to 1 item.', [ - '%action' => 'Unpublish content', - ])); + $this->assertSession()->pageTextNotContains("Unpublish content was applied to 1 item."); // Re-load the node and check the status. $node = Node::load($node->id()); $this->assertTrue($node->isPublished(), 'The node is still published.'); diff --git a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php index 0142da7efecb..e3d732464eee 100644 --- a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php +++ b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php @@ -320,7 +320,7 @@ public function assertAllowedValuesInput($input_string, $result, $message) { $this->drupalGet($this->adminPath); $this->submitForm($edit, 'Save field settings'); // Verify that the page does not have double escaped HTML tags. - $this->assertNoRaw('&lt;'); + $this->assertSession()->responseNotContains('&lt;'); if (is_string($result)) { $this->assertSession()->pageTextContains($result); diff --git a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php index 699bf0dc82c3..64131a273aed 100644 --- a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php +++ b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php @@ -128,13 +128,13 @@ public function testUserPermissions() { $this->drupalGet('node/1'); // Library and in-place editors. - $this->assertNoRaw('core/modules/quickedit/js/quickedit.js'); - $this->assertNoRaw('core/modules/quickedit/js/editors/formEditor.js'); + $this->assertSession()->responseNotContains('core/modules/quickedit/js/quickedit.js'); + $this->assertSession()->responseNotContains('core/modules/quickedit/js/editors/formEditor.js'); // HTML annotation and title class do not exist for users without // permission to in-place edit. - $this->assertNoRaw('data-quickedit-entity-id="node/1"'); - $this->assertNoRaw('data-quickedit-field-id="node/1/body/en/full"'); + $this->assertSession()->responseNotContains('data-quickedit-entity-id="node/1"'); + $this->assertSession()->responseNotContains('data-quickedit-field-id="node/1/body/en/full"'); $this->assertSession()->elementNotExists('xpath', '//h1[contains(@class, "js-quickedit-page-title")]'); $assert->linkNotExists('Quick edit'); @@ -191,8 +191,8 @@ public function testWithPendingRevision() { $this->drupalGet('node/add/article'); $this->submitForm(['title[0][value]' => 'foo'], 'Preview'); // Verify that quickedit is not active on preview. - $this->assertNoRaw('data-quickedit-entity-id="node/' . $this->testNode->id() . '"'); - $this->assertNoRaw('data-quickedit-field-id="node/' . $this->testNode->id() . '/title/' . $this->testNode->language()->getId() . '/full"'); + $this->assertSession()->responseNotContains('data-quickedit-entity-id="node/' . $this->testNode->id() . '"'); + $this->assertSession()->responseNotContains('data-quickedit-field-id="node/' . $this->testNode->id() . '/title/' . $this->testNode->language()->getId() . '/full"'); $this->drupalGet('node/' . $this->testNode->id()); $this->assertRaw('data-quickedit-entity-id="node/' . $this->testNode->id() . '"'); @@ -208,8 +208,8 @@ public function testWithPendingRevision() { $this->testNode->save(); $this->drupalGet('node/' . $this->testNode->id()); - $this->assertNoRaw('data-quickedit-entity-id="node/' . $this->testNode->id() . '"'); - $this->assertNoRaw('data-quickedit-field-id="node/' . $this->testNode->id() . '/title/' . $this->testNode->language()->getId() . '/full"'); + $this->assertSession()->responseNotContains('data-quickedit-entity-id="node/' . $this->testNode->id() . '"'); + $this->assertSession()->responseNotContains('data-quickedit-field-id="node/' . $this->testNode->id() . '/title/' . $this->testNode->language()->getId() . '/full"'); } /** diff --git a/core/modules/search/tests/src/Functional/SearchAdminThemeTest.php b/core/modules/search/tests/src/Functional/SearchAdminThemeTest.php index 18237617d54a..2cd49c8a9109 100644 --- a/core/modules/search/tests/src/Functional/SearchAdminThemeTest.php +++ b/core/modules/search/tests/src/Functional/SearchAdminThemeTest.php @@ -99,7 +99,7 @@ protected function assertAdminTheme($is_admin) { $this->assertRaw('core/themes/' . $this->adminTheme); } else { - $this->assertNoRaw('core/themes/' . $this->adminTheme); + $this->assertSession()->responseNotContains('core/themes/' . $this->adminTheme); } } diff --git a/core/modules/search/tests/src/Functional/SearchCommentTest.php b/core/modules/search/tests/src/Functional/SearchCommentTest.php index a578d9f27606..974d494ee21c 100644 --- a/core/modules/search/tests/src/Functional/SearchCommentTest.php +++ b/core/modules/search/tests/src/Functional/SearchCommentTest.php @@ -190,7 +190,7 @@ public function testSearchResultsComment() { // Verify the evil comment subject is escaped in search results. $this->assertRaw('<script>alert('<strong>subjectkeyword</strong>');'); - $this->assertNoRaw('<script>'); + $this->assertSession()->responseNotContains('<script>'); // Search for the keyword near the evil script tag in the comment body. $edit = [ @@ -202,7 +202,7 @@ public function testSearchResultsComment() { // Verify that nearby script tag in the evil comment body is stripped from // search results. $this->assertRaw('<strong>nearbykeyword</strong>'); - $this->assertNoRaw('<script>'); + $this->assertSession()->responseNotContains('<script>'); // Search for contents inside the evil script tag in the comment body. $edit = [ @@ -215,7 +215,7 @@ public function testSearchResultsComment() { // https://www.drupal.org/node/2551135 // Verify there is no script tag in search results. - $this->assertNoRaw('<script>'); + $this->assertSession()->responseNotContains('<script>'); // Hide comments. $this->drupalLogin($this->adminUser); diff --git a/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php b/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php index b160a311abf3..87157b4736dd 100644 --- a/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php +++ b/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php @@ -92,7 +92,7 @@ public function testPhraseSearchPunctuation() { $edit = ['keys' => 'Enritchment']; $this->drupalGet('search/node'); $this->submitForm($edit, 'Search'); - $this->assertNoRaw('<strong>Enricþment</strong>'); + $this->assertSession()->responseNotContains('<strong>Enricþment</strong>'); $edit = ['keys' => 'æll']; $this->drupalGet('search/node'); @@ -102,7 +102,7 @@ public function testPhraseSearchPunctuation() { $edit = ['keys' => 'all']; $this->drupalGet('search/node'); $this->submitForm($edit, 'Search'); - $this->assertNoRaw('<strong>æll</strong>'); + $this->assertSession()->responseNotContains('<strong>æll</strong>'); // cSpell:enable } diff --git a/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php b/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php index 774076b867be..52a482744c69 100644 --- a/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php +++ b/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php @@ -72,13 +72,13 @@ public function testPhraseSearchPunctuation() { $edit = ['keys' => '&']; $this->drupalGet('search/node'); $this->submitForm($edit, 'Search'); - $this->assertNoRaw('<strong>&</strong>amp;'); + $this->assertSession()->responseNotContains('<strong>&</strong>amp;'); $this->assertSession()->pageTextContains('You must include at least one keyword'); $edit = ['keys' => '&']; $this->drupalGet('search/node'); $this->submitForm($edit, 'Search'); - $this->assertNoRaw('<strong>&</strong>amp;'); + $this->assertSession()->responseNotContains('<strong>&</strong>amp;'); $this->assertSession()->pageTextContains('You must include at least one keyword'); } diff --git a/core/modules/system/tests/src/Functional/Batch/PageTest.php b/core/modules/system/tests/src/Functional/Batch/PageTest.php index f6abdc1f2a47..5bc95543b51a 100644 --- a/core/modules/system/tests/src/Functional/Batch/PageTest.php +++ b/core/modules/system/tests/src/Functional/Batch/PageTest.php @@ -79,7 +79,7 @@ public function testBatchProgressMessages() { // Check that the initial progress message appears correctly and is not // double escaped. $this->assertRaw('<div class="progress__description">Initializing.<br /> </div>'); - $this->assertNoRaw('&nbsp;'); + $this->assertSession()->responseNotContains('&nbsp;'); // Now also go to the next step. $this->maximumMetaRefreshCount = 1; $this->drupalGet('batch-test/test-title'); diff --git a/core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php b/core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php index 12da4112a5ee..b71cdc272050 100644 --- a/core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php +++ b/core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php @@ -50,11 +50,11 @@ public function testPager() { // Item 51 should not be present. $this->assertRaw('Test entity 50'); - $this->assertNoRaw('Test entity 51'); + $this->assertSession()->responseNotContains('Test entity 51'); // Browse to the next page, test entity 51 is shown. $this->clickLink('Page 2'); - $this->assertNoRaw('Test entity 50'); + $this->assertSession()->responseNotContains('Test entity 50'); $this->assertRaw('Test entity 51'); } diff --git a/core/modules/system/tests/src/Functional/Form/FormTest.php b/core/modules/system/tests/src/Functional/Form/FormTest.php index eec3ee307e6a..97467c81aaad 100644 --- a/core/modules/system/tests/src/Functional/Form/FormTest.php +++ b/core/modules/system/tests/src/Functional/Form/FormTest.php @@ -333,7 +333,7 @@ public function testGetFormsCsrfToken() { $this->drupalLogin($account); $this->drupalGet(Url::fromRoute('form_test.get_form')); - $this->assertNoRaw('form_token'); + $this->assertSession()->responseNotContains('form_token'); } /** @@ -351,7 +351,7 @@ public function testRequiredTextfieldNoTitle() { $edit = []; $this->drupalGet('form-test/validate-required-no-title'); $this->submitForm($edit, 'Submit'); - $this->assertNoRaw("The form_test_validate_required_form_no_title form was submitted successfully."); + $this->assertSession()->pageTextNotContains("The form_test_validate_required_form_no_title form was submitted successfully."); // Check the page for the error class on the textfield. $this->assertSession()->elementExists('xpath', '//input[contains(@class, "error")]'); @@ -411,7 +411,7 @@ public function testSelect() { // Verify that the options are escaped as expected. $this->assertSession()->assertEscaped('<strong>four</strong>'); - $this->assertNoRaw('<strong>four</strong>'); + $this->assertSession()->responseNotContains('<strong>four</strong>'); // Posting without any values should throw validation errors. $this->submitForm([], 'Submit'); @@ -662,7 +662,7 @@ public function testNumber() { $this->assertRaw(new FormattableMarkup($message, $placeholders)); } else { - $this->assertNoRaw(new FormattableMarkup($message, $placeholders)); + $this->assertSession()->responseNotContains(new FormattableMarkup($message, $placeholders)); } } } diff --git a/core/modules/system/tests/src/Functional/Menu/MenuLinkSecurityTest.php b/core/modules/system/tests/src/Functional/Menu/MenuLinkSecurityTest.php index 9de239b8bf13..bb674dd7cae2 100644 --- a/core/modules/system/tests/src/Functional/Menu/MenuLinkSecurityTest.php +++ b/core/modules/system/tests/src/Functional/Menu/MenuLinkSecurityTest.php @@ -36,8 +36,8 @@ public function testMenuLink() { $this->drupalPlaceBlock('system_menu_block:tools'); $this->drupalGet('<front>'); - $this->assertNoRaw('<script>alert("Wild animals")</script>'); - $this->assertNoRaw('<script>alert("Even more wild animals")</script>'); + $this->assertSession()->responseNotContains('<script>alert("Wild animals")</script>'); + $this->assertSession()->responseNotContains('<script>alert("Even more wild animals")</script>'); $this->assertSession()->assertEscaped('<script>alert("Wild animals")</script>'); $this->assertSession()->assertEscaped('<script>alert("Even more wild animals")</script>'); } diff --git a/core/modules/system/tests/src/Functional/Module/UninstallTest.php b/core/modules/system/tests/src/Functional/Module/UninstallTest.php index f3dcfa8796f6..c02869a668df 100644 --- a/core/modules/system/tests/src/Functional/Module/UninstallTest.php +++ b/core/modules/system/tests/src/Functional/Module/UninstallTest.php @@ -126,7 +126,7 @@ public function testUninstallPage() { $this->submitForm([], 'Uninstall'); $this->assertSession()->pageTextContains('The selected modules have been uninstalled.'); // Check that the page does not have double escaped HTML tags. - $this->assertNoRaw('<label'); + $this->assertSession()->responseNotContains('<label'); // Make sure our unique cache entry is gone. $cached = \Drupal::cache()->get('uninstall_test'); diff --git a/core/modules/system/tests/src/Functional/Routing/RouterPermissionTest.php b/core/modules/system/tests/src/Functional/Routing/RouterPermissionTest.php index 032d23a165df..4f8937388ed0 100644 --- a/core/modules/system/tests/src/Functional/Routing/RouterPermissionTest.php +++ b/core/modules/system/tests/src/Functional/Routing/RouterPermissionTest.php @@ -39,7 +39,7 @@ public function testPermissionAccess() { $this->drupalLogin($user); $this->drupalGet('router_test/test7'); $this->assertSession()->statusCodeEquals(200); - $this->assertNoRaw('Access denied'); + $this->assertSession()->responseNotContains('Access denied'); $this->assertRaw('test7text'); } diff --git a/core/modules/system/tests/src/Functional/System/DefaultMobileMetaTagsTest.php b/core/modules/system/tests/src/Functional/System/DefaultMobileMetaTagsTest.php index 5fb4a5d4dd18..295466bc2f9b 100644 --- a/core/modules/system/tests/src/Functional/System/DefaultMobileMetaTagsTest.php +++ b/core/modules/system/tests/src/Functional/System/DefaultMobileMetaTagsTest.php @@ -47,7 +47,7 @@ public function testRemovingDefaultMetaTags() { \Drupal::service('module_installer')->install(['system_module_test']); $this->drupalGet(''); foreach ($this->defaultMetaTags as $name => $metatag) { - $this->assertNoRaw($metatag); + $this->assertSession()->responseNotContains($metatag); } } diff --git a/core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php b/core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php index 59658be618bb..7f27c054e031 100644 --- a/core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php +++ b/core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php @@ -58,7 +58,7 @@ public function testErrorHandler() { $this->assertRaw('<pre class="backtrace">'); // Ensure we are escaping but not double escaping. $this->assertRaw('&'); - $this->assertNoRaw('&amp;'); + $this->assertSession()->responseNotContains('&amp;'); // Set error reporting to display verbose notices. $this->config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save(); @@ -70,7 +70,7 @@ public function testErrorHandler() { $this->assertErrorMessage($error_notice); $this->assertErrorMessage($error_warning); $this->assertErrorMessage($error_user_notice); - $this->assertNoRaw('<pre class="backtrace">'); + $this->assertSession()->responseNotContains('<pre class="backtrace">'); // Set error reporting to not collect notices. $config->set('error_level', ERROR_REPORTING_DISPLAY_SOME)->save(); @@ -79,7 +79,7 @@ public function testErrorHandler() { $this->assertNoErrorMessage($error_notice); $this->assertErrorMessage($error_warning); $this->assertErrorMessage($error_user_notice); - $this->assertNoRaw('<pre class="backtrace">'); + $this->assertSession()->responseNotContains('<pre class="backtrace">'); // Set error reporting to not show any errors. $config->set('error_level', ERROR_REPORTING_HIDE)->save(); @@ -89,7 +89,7 @@ public function testErrorHandler() { $this->assertNoErrorMessage($error_warning); $this->assertNoErrorMessage($error_user_notice); $this->assertNoMessages(); - $this->assertNoRaw('<pre class="backtrace">'); + $this->assertSession()->responseNotContains('<pre class="backtrace">'); } /** @@ -161,7 +161,7 @@ public function assertErrorMessage(array $error) { */ public function assertNoErrorMessage(array $error) { $message = new FormattableMarkup('%type: @message in %function (line ', $error); - $this->assertNoRaw($message); + $this->assertSession()->responseNotContains($message); } /** diff --git a/core/modules/system/tests/src/Functional/System/PageTitleTest.php b/core/modules/system/tests/src/Functional/System/PageTitleTest.php index 12e1c8a538d4..5768af90b1c6 100644 --- a/core/modules/system/tests/src/Functional/System/PageTitleTest.php +++ b/core/modules/system/tests/src/Functional/System/PageTitleTest.php @@ -98,14 +98,14 @@ public function testTitleXSS() { // Test the title, checking for the lack of the unfiltered version of the // title. - $this->assertNoRaw($title); + $this->assertSession()->responseNotContains($title); // Add </title> to make sure we're checking the title tag, rather than the // first 'heading' on the page. $this->assertRaw($title_filtered . '</title>'); // Test the slogan. // Check the unfiltered version of the slogan is missing. - $this->assertNoRaw($slogan); + $this->assertSession()->responseNotContains($slogan); // Check for the filtered version of the slogan. $this->assertRaw($slogan_filtered); } diff --git a/core/modules/system/tests/src/Functional/System/ThemeTest.php b/core/modules/system/tests/src/Functional/System/ThemeTest.php index d481a1d17d91..39b93b19939e 100644 --- a/core/modules/system/tests/src/Functional/System/ThemeTest.php +++ b/core/modules/system/tests/src/Functional/System/ThemeTest.php @@ -414,12 +414,12 @@ public function testUninstallingThemes() { $this->clickLink('Set as default'); // Check that seven cannot be uninstalled as it is the admin theme. - $this->assertNoRaw('Uninstall Seven theme'); + $this->assertSession()->responseNotContains('Uninstall Seven theme'); // Check that bartik cannot be uninstalled as it is the default theme. - $this->assertNoRaw('Uninstall Bartik theme'); + $this->assertSession()->responseNotContains('Uninstall Bartik theme'); // Check that the classy theme cannot be uninstalled as it is a base theme // of seven and bartik. - $this->assertNoRaw('Uninstall Classy theme'); + $this->assertSession()->responseNotContains('Uninstall Classy theme'); // Install Stark and set it as the default theme. \Drupal::service('theme_installer')->install(['stark']); @@ -435,7 +435,7 @@ public function testUninstallingThemes() { $this->assertRaw('Uninstall Seven theme'); // Check that the classy theme still cannot be uninstalled as it is a // base theme of bartik. - $this->assertNoRaw('Uninstall Classy theme'); + $this->assertSession()->responseNotContains('Uninstall Classy theme'); // Change the default theme to stark, stark is second in the list. $this->clickLink('Set as default', 1); @@ -445,7 +445,7 @@ public function testUninstallingThemes() { // Check that the classy theme still can't be uninstalled as neither of its // base themes have been. - $this->assertNoRaw('Uninstall Classy theme'); + $this->assertSession()->responseNotContains('Uninstall Classy theme'); // Uninstall each of the three themes starting with Bartik. $this->clickLink('Uninstall'); @@ -455,7 +455,7 @@ public function testUninstallingThemes() { $this->assertRaw('The <em class="placeholder">Seven</em> theme has been uninstalled'); // Check that the classy theme still can't be uninstalled as it is hidden. - $this->assertNoRaw('Uninstall Classy theme'); + $this->assertSession()->responseNotContains('Uninstall Classy theme'); } /** diff --git a/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php b/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php index 2291b78dac77..820554fa0714 100644 --- a/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php +++ b/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php @@ -147,7 +147,7 @@ public function testThemedEntity() { foreach ($paths as $path) { $this->drupalGet($path); $this->assertSession()->statusCodeEquals(200); - $this->assertNoRaw($this->xssLabel); + $this->assertSession()->responseNotContains($this->xssLabel); } } } diff --git a/core/modules/taxonomy/tests/src/Functional/RssTest.php b/core/modules/taxonomy/tests/src/Functional/RssTest.php index 848616017b58..284f9f22b5e5 100644 --- a/core/modules/taxonomy/tests/src/Functional/RssTest.php +++ b/core/modules/taxonomy/tests/src/Functional/RssTest.php @@ -143,7 +143,7 @@ public function testTaxonomyRss() { // Unpublish the article and check that it is not shown in the feed. $node->setUnpublished()->save(); $this->drupalGet('taxonomy/term/all/feed'); - $this->assertNoRaw($raw_xml); + $this->assertSession()->responseNotContains($raw_xml); } } diff --git a/core/modules/update/tests/src/Functional/UpdateContribTest.php b/core/modules/update/tests/src/Functional/UpdateContribTest.php index c0ba0767ba54..38430d8fa8f4 100644 --- a/core/modules/update/tests/src/Functional/UpdateContribTest.php +++ b/core/modules/update/tests/src/Functional/UpdateContribTest.php @@ -74,7 +74,7 @@ public function testNoReleasesAvailable() { $this->assertSession()->responseContains('<h3>Modules</h3>'); $this->assertSession()->pageTextNotContains('Update available'); $this->assertSession()->pageTextContains('No available releases found'); - $this->assertNoRaw(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString()); + $this->assertSession()->responseNotContains(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString()); $available = update_get_available(); $this->assertFalse(isset($available['aaa_update_test']['fetch_status']), 'Results are cached even if no releases are available.'); @@ -118,7 +118,7 @@ public function testUpdateContribBasic() { 'aaa_update_test' => '1_0', ] ); - $this->assertNoRaw($project_link); + $this->assertSession()->responseNotContains($project_link); // A hidden and installed project not in the Testing package should appear. $system_info['aaa_update_test']['package'] = 'aaa_update_test'; @@ -190,7 +190,7 @@ public function testUpdateContribOrder() { $this->assertSession()->pageTextContains('CCC Update test'); // We want aaa_update_test included in the ccc_update_test project, not as // its own project on the report. - $this->assertNoRaw(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString()); + $this->assertSession()->responseNotContains(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString()); // The other two should be listed as projects. $this->assertRaw(Link::fromTextAndUrl(t('BBB Update test'), Url::fromUri('http://example.com/project/bbb_update_test'))->toString()); $this->assertRaw(Link::fromTextAndUrl(t('CCC Update test'), Url::fromUri('http://example.com/project/ccc_update_test'))->toString()); @@ -279,7 +279,7 @@ public function testNormalUpdateAvailable() { // The XML test fixtures for this method all contain the '8.x-3.0' // release but because '8.x-3.0' is not in a supported branch it will // not be in the available updates. - $this->assertNoRaw('8.x-3.0'); + $this->assertSession()->responseNotContains('8.x-3.0'); // Set a CSS selector in order for assertions to target the 'Modules' // table and not Drupal core updates. $this->updateTableLocator = 'table.update:nth-of-type(2)'; @@ -405,8 +405,8 @@ public function testUpdateShowDisabledThemes() { } else { $this->assertSession()->pageTextNotContains('Uninstalled themes'); - $this->assertNoRaw($base_theme_project_link); - $this->assertNoRaw($sub_theme_project_link); + $this->assertSession()->responseNotContains($base_theme_project_link); + $this->assertSession()->responseNotContains($sub_theme_project_link); } } } @@ -497,7 +497,7 @@ public function testUpdateBrokenFetchURL() { // The other two should be listed as projects. $this->assertRaw(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString()); - $this->assertNoRaw(Link::fromTextAndUrl(t('BBB Update test'), Url::fromUri('http://example.com/project/bbb_update_test'))->toString()); + $this->assertSession()->responseNotContains(Link::fromTextAndUrl(t('BBB Update test'), Url::fromUri('http://example.com/project/bbb_update_test'))->toString()); $this->assertRaw(Link::fromTextAndUrl(t('CCC Update test'), Url::fromUri('http://example.com/project/ccc_update_test'))->toString()); } diff --git a/core/modules/update/tests/src/Functional/UpdateSemverTestBase.php b/core/modules/update/tests/src/Functional/UpdateSemverTestBase.php index b8a3be824ab0..348927bf8a0f 100644 --- a/core/modules/update/tests/src/Functional/UpdateSemverTestBase.php +++ b/core/modules/update/tests/src/Functional/UpdateSemverTestBase.php @@ -100,7 +100,7 @@ public function testNormalUpdateAvailable() { // The XML test fixtures for this method all contain the '8.2.0' release // but because '8.2.0' is not in a supported branch it will not be in // the available updates. - $this->assertNoRaw('8.2.0'); + $this->assertSession()->responseNotContains('8.2.0'); switch ($minor_version) { case 0: // Both stable and unstable releases are available. diff --git a/core/modules/user/tests/src/Functional/UserCreateTest.php b/core/modules/user/tests/src/Functional/UserCreateTest.php index fa4513cf96d2..b87998ff83f0 100644 --- a/core/modules/user/tests/src/Functional/UserCreateTest.php +++ b/core/modules/user/tests/src/Functional/UserCreateTest.php @@ -81,7 +81,7 @@ public function testUserAdd() { $this->assertSession()->checkboxChecked('edit-status-1'); // Test that browser autocomplete behavior does not occur. - $this->assertNoRaw('data-user-info-from-browser'); + $this->assertSession()->responseNotContains('data-user-info-from-browser'); // Test that the password strength indicator displays. $config = $this->config('user.settings'); diff --git a/core/modules/user/tests/src/Functional/UserPictureTest.php b/core/modules/user/tests/src/Functional/UserPictureTest.php index e83d2a214dfc..cd32b252eb9c 100644 --- a/core/modules/user/tests/src/Functional/UserPictureTest.php +++ b/core/modules/user/tests/src/Functional/UserPictureTest.php @@ -145,7 +145,7 @@ public function testPictureOnNodeComment() { ->save(); $this->drupalGet('node/' . $node->id()); - $this->assertNoRaw(StreamWrapperManager::getTarget($file->getFileUri())); + $this->assertSession()->responseNotContains(StreamWrapperManager::getTarget($file->getFileUri())); } /** diff --git a/core/modules/user/tests/src/Functional/Views/BulkFormTest.php b/core/modules/user/tests/src/Functional/Views/BulkFormTest.php index 373a2143812a..1ab4de22a805 100644 --- a/core/modules/user/tests/src/Functional/Views/BulkFormTest.php +++ b/core/modules/user/tests/src/Functional/Views/BulkFormTest.php @@ -93,7 +93,7 @@ public function testBulkForm() { $user_storage->resetCache([$account->id()]); $account = $user_storage->load($account->id()); $this->assertTrue($account->isBlocked(), 'The user is blocked.'); - $this->assertNoRaw($account->label()); + $this->assertSession()->pageTextNotContains($account->label()); // Remove the user status filter from the view. $view = Views::getView('test_user_bulk_form'); diff --git a/core/modules/user/tests/src/Functional/Views/HandlerFilterUserNameTest.php b/core/modules/user/tests/src/Functional/Views/HandlerFilterUserNameTest.php index 3d434de1f90a..f2e87d53c9e4 100644 --- a/core/modules/user/tests/src/Functional/Views/HandlerFilterUserNameTest.php +++ b/core/modules/user/tests/src/Functional/Views/HandlerFilterUserNameTest.php @@ -172,7 +172,7 @@ public function testExposedFilter() { $options['query']['uid'] = implode(', ', $users); $this->drupalGet($path, $options); - $this->assertNoRaw('Unable to find user'); + $this->assertSession()->pageTextNotContains('Unable to find user'); // The actual result should contain all of the user ids. foreach ($this->accounts as $account) { $this->assertRaw($account->id()); @@ -184,7 +184,7 @@ public function testExposedFilter() { }, $this->accounts); $this->drupalGet($path, $options); - $this->assertNoRaw('Unable to find user'); + $this->assertSession()->pageTextNotContains('Unable to find user'); // The actual result should contain all of the user ids. foreach ($this->accounts as $account) { $this->assertRaw($account->id()); diff --git a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php index d2e9324995b3..9b8a1930b3ed 100644 --- a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php +++ b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php @@ -243,7 +243,7 @@ public function testExposedBlock($display) { // Assert that the only occurrence of `$view->getTitle()` is the title tag // now that label has been removed. $this->drupalGet('test_exposed_block'); - $this->assertNoRaw('<strong>Custom</strong> titlealert("hacked!");'); + $this->assertSession()->responseNotContains('<strong>Custom</strong> titlealert("hacked!");'); $this->assertSession()->elementContains('css', 'title', $view->getTitle()); $this->assertSession()->pageTextMatchesCount(1, '/' . $view->getTitle() . '/'); @@ -397,9 +397,9 @@ public function testExposedSortAndItemsPerPage() { // Make sure we see the single-escaped string in the raw output. $this->assertRaw($escape_1); // But no double-escaped string. - $this->assertNoRaw($escape_2); + $this->assertSession()->responseNotContains($escape_2); // And not the raw label, either. - $this->assertNoRaw($expected_label); + $this->assertSession()->responseNotContains($expected_label); // Check that the custom field identifier is used in the URL query string. $this->submitForm(['sort_order' => 'DESC'], 'Apply'); diff --git a/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php b/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php index fa452d255991..461346ba6db2 100644 --- a/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php +++ b/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php @@ -210,7 +210,7 @@ public function testGrouping() { ]; // Ensure that we don't find the caption containing unsafe markup. - $this->assertNoRaw($unsafe_markup); + $this->assertSession()->responseNotContains($unsafe_markup); // Ensure that the summary isn't shown. $this->assertEmpty($this->xpath('//caption/details')); @@ -234,7 +234,7 @@ public function testGrouping() { ]; // Ensure that we don't find the caption containing unsafe markup. - $this->assertNoRaw($unsafe_markup); + $this->assertSession()->responseNotContains($unsafe_markup); // Ensure that all expected captions are found. foreach ($expected_captions as $raw_caption) { diff --git a/core/modules/views/tests/src/Functional/ViewsEscapingTest.php b/core/modules/views/tests/src/Functional/ViewsEscapingTest.php index fdffb7fec357..440292961fbe 100644 --- a/core/modules/views/tests/src/Functional/ViewsEscapingTest.php +++ b/core/modules/views/tests/src/Functional/ViewsEscapingTest.php @@ -83,7 +83,7 @@ public function testViewsFieldHeaderEscaping() { $this->drupalGet('test_field_header_xss'); // Assert that harmful tags are escaped in header label. - $this->assertNoRaw('<script>alert("XSS")</script>'); + $this->assertSession()->responseNotContains('<script>alert("XSS")</script>'); } } diff --git a/core/modules/views_ui/tests/src/Functional/DisplayAttachmentTest.php b/core/modules/views_ui/tests/src/Functional/DisplayAttachmentTest.php index 0ad459e2de78..346461ed65ab 100644 --- a/core/modules/views_ui/tests/src/Functional/DisplayAttachmentTest.php +++ b/core/modules/views_ui/tests/src/Functional/DisplayAttachmentTest.php @@ -45,7 +45,7 @@ public function testAttachmentUI() { $this->submitForm(['displays[page_1]' => 1], 'Apply'); // Options summary should be escaped. $this->assertSession()->assertEscaped('<em>Page</em>'); - $this->assertNoRaw('<em>Page</em>'); + $this->assertSession()->responseNotContains('<em>Page</em>'); $this->assertSession()->elementAttributeContains('xpath', '//a[@id = "views-attachment-1-displays"]', 'title', 'Page'); $this->submitForm([], 'Save'); diff --git a/core/modules/views_ui/tests/src/Functional/DisplayFeedTest.php b/core/modules/views_ui/tests/src/Functional/DisplayFeedTest.php index 35269da794e4..0005722f2183 100644 --- a/core/modules/views_ui/tests/src/Functional/DisplayFeedTest.php +++ b/core/modules/views_ui/tests/src/Functional/DisplayFeedTest.php @@ -75,7 +75,7 @@ protected function checkFeedViewUi($view_name) { $this->submitForm(['displays[page]' => 'page'], 'Apply'); // Options summary should be escaped. $this->assertSession()->assertEscaped('<em>Page</em>'); - $this->assertNoRaw('<em>Page</em>'); + $this->assertSession()->responseNotContains('<em>Page</em>'); $this->drupalGet('admin/structure/views/view/' . $view_name . '/edit/feed_1'); $this->assertSession()->elementTextContains('xpath', '//*[@id="views-feed-1-displays"]', 'Page'); diff --git a/core/modules/views_ui/tests/src/Functional/DisplayTest.php b/core/modules/views_ui/tests/src/Functional/DisplayTest.php index e09bd698d847..8289f8ee5652 100644 --- a/core/modules/views_ui/tests/src/Functional/DisplayTest.php +++ b/core/modules/views_ui/tests/src/Functional/DisplayTest.php @@ -228,15 +228,15 @@ public function testDisplayTitleInButtonsXss() { $this->drupalGet("admin/structure/views/view/{$view->id()}"); $escaped = views_ui_truncate($input, 25); $this->assertSession()->assertEscaped($escaped); - $this->assertNoRaw($xss_markup); + $this->assertSession()->responseNotContains($xss_markup); $this->drupalGet("admin/structure/views/view/{$view->id()}/edit/page_1"); $this->assertSession()->assertEscaped("View $escaped"); - $this->assertNoRaw("View $xss_markup"); + $this->assertSession()->responseNotContains("View $xss_markup"); $this->assertSession()->assertEscaped("Duplicate $escaped"); - $this->assertNoRaw("Duplicate $xss_markup"); + $this->assertSession()->responseNotContains("Duplicate $xss_markup"); $this->assertSession()->assertEscaped("Delete $escaped"); - $this->assertNoRaw("Delete $xss_markup"); + $this->assertSession()->responseNotContains("Delete $xss_markup"); } } @@ -254,7 +254,7 @@ public function testActionLinks() { // Ensure that the title is escaped as expected. $this->assertSession()->assertEscaped($display_title); - $this->assertNoRaw($display_title); + $this->assertSession()->responseNotContains($display_title); // Ensure that the dropdown buttons are displayed correctly. $this->assertSession()->buttonExists('Duplicate ' . $display_title); @@ -269,7 +269,7 @@ public function testActionLinks() { // Ensure that the title is escaped as expected. $this->assertSession()->assertEscaped($display_title); - $this->assertNoRaw($display_title); + $this->assertSession()->responseNotContains($display_title); } /** diff --git a/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php b/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php index 62b8ba89da13..5cd30b04aed9 100644 --- a/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php +++ b/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php @@ -303,7 +303,7 @@ public function testGroupedFilterAdminUiErrors() { protected function assertNoGroupedFilterErrors($message = '', $group = 'Other') { foreach ($this->groupFormUiErrors as $error) { if (empty($message)) { - return $this->assertNoRaw($error); + return $this->assertSession()->responseNotContains($error); } } return TRUE; diff --git a/core/modules/views_ui/tests/src/Functional/FilterUITest.php b/core/modules/views_ui/tests/src/Functional/FilterUITest.php index 1c57c22ed4e7..a6c265bb3153 100644 --- a/core/modules/views_ui/tests/src/Functional/FilterUITest.php +++ b/core/modules/views_ui/tests/src/Functional/FilterUITest.php @@ -80,7 +80,7 @@ public function testFiltersUI() { // Tests that we can create a new filter group from UI. $this->drupalGet('admin/structure/views/nojs/rearrange-filter/test_filter_groups/page'); - $this->assertNoRaw('<span>Group 3</span>'); + $this->assertSession()->elementNotExists('xpath', '//span[text()="Group 3"]'); // Create 2 new groups. $this->submitForm([], 'Create new filter group'); @@ -96,7 +96,7 @@ public function testFiltersUI() { $this->submitForm([], 'Remove group 3'); // Group 3 now does not exist. - $this->assertNoRaw('<span>Group 3</span>'); + $this->assertSession()->elementNotExists('xpath', '//span[text()="Group 3"]'); } /** diff --git a/core/modules/views_ui/tests/src/Functional/PreviewTest.php b/core/modules/views_ui/tests/src/Functional/PreviewTest.php index 08a93c8c3e6c..dc69eed2d5cf 100644 --- a/core/modules/views_ui/tests/src/Functional/PreviewTest.php +++ b/core/modules/views_ui/tests/src/Functional/PreviewTest.php @@ -93,7 +93,7 @@ public function testPreviewUI() { $this->assertSession()->pageTextContains('Query build time'); $this->assertSession()->pageTextContains('Query execute time'); $this->assertSession()->pageTextContains('View render time'); - $this->assertNoRaw('<strong>Query</strong>'); + $this->assertSession()->responseNotContains('<strong>Query</strong>'); // Statistics and query. $settings->set('ui.show.sql_query.enabled', TRUE)->save(); diff --git a/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php b/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php index e587f1003a60..c6747386f500 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php +++ b/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php @@ -32,7 +32,7 @@ public function testInstaller() { */ protected function setUpSite() { // Test that the correct theme is being used. - $this->assertNoRaw('bartik'); + $this->assertSession()->responseNotContains('bartik'); $this->assertRaw('themes/seven/css/theme/install-page.css'); parent::setUpSite(); } diff --git a/core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php b/core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php index 5ca2024e86cf..73ff4100421e 100644 --- a/core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php +++ b/core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php @@ -76,6 +76,7 @@ public function testAssertRaw() { * @covers ::assertNoRaw */ public function testAssertNoRaw() { + $this->expectDeprecation('AssertLegacyTrait::assertNoRaw() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseNotContains() instead. See https://www.drupal.org/node/3129738'); $this->expectDeprecation('Calling AssertLegacyTrait::assertNoRaw() with more that one argument is deprecated in drupal:8.2.0 and the method is removed from drupal:10.0.0. Use $this->assertSession()->responseNotContains() instead. See https://www.drupal.org/node/3129738'); $this->page->getText()->willReturn('foo bar bar'); $this->assertNoRaw('qux', '\'qux\' should not be present.'); diff --git a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php index bd7330d36505..aec1092b5703 100644 --- a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php +++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php @@ -121,7 +121,6 @@ public static function getSkippedDeprecations() { "The \"PHPUnit\Framework\TestSuite\" class is considered internal This class is not covered by the backward compatibility promise for PHPUnit. It may change without further notice. You should not use it from \"Drupal\Tests\TestSuites\TestSuiteBase\".", // Simpletest's legacy assertion methods. 'AssertLegacyTrait::assertRaw() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseContains() instead. See https://www.drupal.org/node/3129738', - 'AssertLegacyTrait::assertNoRaw() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseNotContains() instead. See https://www.drupal.org/node/3129738', // PHPUnit 9. "The \"PHPUnit\TextUI\DefaultResultPrinter\" class is considered internal This class is not covered by the backward compatibility promise for PHPUnit. It may change without further notice. You should not use it from \"Drupal\Tests\Listeners\HtmlOutputPrinter\".", ]; -- GitLab