From b7627bcae46b6fd98c71dd95b93a76ca07c72fa8 Mon Sep 17 00:00:00 2001 From: catch Date: Tue, 14 Jul 2020 10:58:42 +0100 Subject: [PATCH] Issue #3123120 by mondrake, ridhimaabrol24, longwave: Properly deprecate AssertLegacyTrait::pass --- .../tests/src/Functional/BigPipeTest.php | 26 ++++---- .../tests/src/Kernel/BlockViewBuilderTest.php | 3 - .../Functional/BlockContentCreationTest.php | 2 +- .../BlockContentTranslationUITest.php | 4 +- .../Migrate/MigrateBlockContentStubTest.php | 13 ++-- .../tests/src/Functional/CommentPagerTest.php | 1 - .../tests/src/Functional/CommentTypeTest.php | 2 +- .../Kernel/CommentStringIdEntitiesTest.php | 39 ++++++------ .../tests/src/Functional/ConfigEntityTest.php | 20 ++----- .../SchemaConfigListenerWebTest.php | 12 +--- .../src/Functional/EditorSecurityTest.php | 11 ---- .../Kernel/EditorFileReferenceFilterTest.php | 16 ++--- ...qlContentEntityStorageSchemaColumnTest.php | 13 ++-- .../EntityReferenceItemTest.php | 4 +- .../field/tests/src/Kernel/FieldCrudTest.php | 4 +- .../Kernel/FieldDefinitionIntegrityTest.php | 29 ++------- .../tests/src/Kernel/FieldStorageCrudTest.php | 41 +++++++------ .../tests/src/Functional/FilterFormTest.php | 4 -- .../hal/tests/src/Kernel/DenormalizeTest.php | 4 +- .../Migrate/d6/MigrateImageCacheTest.php | 15 ++--- .../LanguageDependencyInjectionTest.php | 2 +- .../src/Kernel/EditorMediaDialogTest.php | 4 +- .../src/Functional/MenuCacheTagsTest.php | 5 -- .../NodeAccessGrantsCacheContextTest.php | 1 - .../tests/src/Functional/NodeCreationTest.php | 2 +- .../src/Functional/Views/BulkFormTest.php | 4 -- .../src/Functional/Views/FrontPageTest.php | 2 - .../tests/src/Kernel/OptionsFieldTest.php | 2 +- .../src/Functional/GetRdfNamespacesTest.php | 2 +- .../tests/src/Kernel/SerializationTest.php | 2 +- .../tests/src/Functional/Common/UrlTest.php | 1 - .../src/Functional/Mail/HtmlToTextTest.php | 5 +- .../src/Functional/Menu/LocalTasksTest.php | 8 +-- .../src/Functional/Module/InstallTest.php | 8 +-- .../src/Functional/Module/UninstallTest.php | 2 +- .../src/Functional/Routing/RouterTest.php | 2 +- .../Functional/System/SiteMaintenanceTest.php | 1 - .../src/Kernel/Common/PageRenderTest.php | 2 - .../Kernel/Extension/ModuleHandlerTest.php | 6 +- .../Functional/ToolbarCacheContextsTest.php | 7 +-- .../src/Functional/TourCacheTagsTest.php | 2 - .../src/Kernel/RenderCacheIntegrationTest.php | 15 +---- .../src/Kernel/ViewsConfigUpdaterTest.php | 3 +- .../src/Functional/DemoUmamiProfileTest.php | 1 - .../Bootstrap/UncaughtExceptionTest.php | 3 +- .../FunctionalTests/BrowserTestBaseTest.php | 54 ++++++++--------- ...istributionProfileExistingSettingsTest.php | 1 - .../MultipleDistributionsProfileTest.php | 1 - .../KernelTests/Config/DefaultConfigTest.php | 5 +- .../Asset/LibraryDiscoveryIntegrationTest.php | 7 +-- .../KernelTests/Core/Command/DbDumpTest.php | 24 +------- .../Core/Config/ConfigCRUDTest.php | 40 +++++-------- .../Core/Config/ConfigEntityStorageTest.php | 3 +- .../Core/Config/ConfigExportStorageTest.php | 9 +-- .../ConfigImportRenameValidationTest.php | 2 - .../Core/Config/ConfigImporterTest.php | 13 ++-- .../Core/Config/ConfigSchemaTest.php | 12 +--- .../Core/Config/Storage/FileStorageTest.php | 1 - .../Core/Database/ConnectionTest.php | 24 ++------ .../Database/DatabaseExceptionWrapperTest.php | 21 +------ .../Core/Database/InsertDefaultsTest.php | 2 +- .../KernelTests/Core/Database/MergeTest.php | 9 +-- .../KernelTests/Core/Database/QueryTest.php | 12 ++-- .../KernelTests/Core/Database/SchemaTest.php | 8 +-- .../KernelTests/Core/Database/SelectTest.php | 11 ++-- .../Core/Database/TransactionTest.php | 36 +++++------ .../Core/DrupalKernel/DrupalKernelTest.php | 5 +- .../KernelTests/Core/Entity/EntityApiTest.php | 2 - .../Core/Entity/EntityAutocompleteTest.php | 9 +-- .../Core/Entity/EntityCrudHookTest.php | 2 +- .../Entity/EntityDefinitionUpdateTest.php | 20 +++---- .../Core/Entity/EntityQueryTest.php | 17 ++---- .../Core/Entity/EntityReferenceFieldTest.php | 7 +-- .../Core/Entity/EntityTranslationTest.php | 60 +++++++------------ .../Core/Entity/FieldSqlStorageTest.php | 11 +--- .../Extension/ModuleImplementsAlterTest.php | 13 ++-- .../KeyValueContentEntityStorageTest.php | 9 ++- .../Core/Menu/MenuTreeStorageTest.php | 3 +- .../KernelTests/Core/Plugin/FactoryTest.php | 10 +--- .../KernelTests/Core/Render/RenderTest.php | 9 +-- .../Routing/ContentNegotiationRoutingTest.php | 6 +- .../Core/Routing/MatcherDumperTest.php | 10 +--- .../Core/Session/AccountSwitcherTest.php | 15 +---- .../Core/Theme/ThemeInstallerTest.php | 28 ++++----- .../Core/TypedData/TypedDataTest.php | 6 +- .../Core/Assert/AssertLegacyTraitTest.php | 8 +++ .../Listeners/DeprecationListenerTrait.php | 1 - 87 files changed, 307 insertions(+), 594 deletions(-) diff --git a/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php b/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php index a4983fded98..92efb10376d 100644 --- a/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php +++ b/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php @@ -186,7 +186,7 @@ class BigPipeTest extends BrowserTestBase { $this->assertRaw('', 'Closing body tag present.'); - $this->pass('Verifying BigPipe assets are present…', 'Debug'); + // Verifying BigPipe assets are present. $this->assertFalse(empty($this->getDrupalSettings()), 'drupalSettings present.'); $this->assertContains('big_pipe/big_pipe', explode(',', $this->getDrupalSettings()['ajaxPageState']['libraries']), 'BigPipe asset library is present.'); @@ -205,7 +205,8 @@ class BigPipeTest extends BrowserTestBase { $this->drupalGet(Url::fromUri('base:non-existing-path')); // Simulate development. - $this->pass('Verifying BigPipe provides useful error output when an error occurs while rendering a placeholder if verbose error logging is enabled.', 'Debug'); + // Verifying BigPipe provides useful error output when an error occurs + // while rendering a placeholder if verbose error logging is enabled. $this->config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save(); $this->drupalGet(Url::fromRoute('big_pipe_test')); // The 'edge_case__html_exception' case throws an exception. @@ -259,13 +260,13 @@ class BigPipeTest extends BrowserTestBase { $cases['exception__embedded_response']->bigPipePlaceholderId => NULL, ]); - $this->pass('Verifying there are no BigPipe placeholders & replacements…', 'Debug'); + // Verifying there are no BigPipe placeholders & replacements. $this->assertEqual('', $this->drupalGetHeader('BigPipe-Test-Placeholders')); - $this->pass('Verifying BigPipe start/stop signals are absent…', 'Debug'); + // Verifying BigPipe start/stop signals are absent. $this->assertNoRaw(BigPipe::START_SIGNAL, 'BigPipe start signal absent.'); $this->assertNoRaw(BigPipe::STOP_SIGNAL, 'BigPipe stop signal absent.'); - $this->pass('Verifying BigPipe assets are absent…', 'Debug'); + // Verifying BigPipe assets are absent. $this->assertTrue(!isset($this->getDrupalSettings()['bigPipePlaceholderIds']) && empty($this->getDrupalSettings()['ajaxPageState']), 'BigPipe drupalSettings and BigPipe asset library absent.'); $this->assertRaw('', 'Closing body tag present.'); @@ -274,7 +275,8 @@ class BigPipeTest extends BrowserTestBase { $this->drupalGet(Url::fromUri('base:non-existing-path')); // Simulate development. - $this->pass('Verifying BigPipe provides useful error output when an error occurs while rendering a placeholder if verbose error logging is enabled.', 'Debug'); + // Verifying BigPipe provides useful error output when an error occurs + // while rendering a placeholder if verbose error logging is enabled. $this->config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save(); $this->drupalGet(Url::fromRoute('big_pipe_test')); // The 'edge_case__html_exception' case throws an exception. @@ -322,7 +324,6 @@ class BigPipeTest extends BrowserTestBase { } protected function assertBigPipeResponseHeadersPresent() { - $this->pass('Verifying BigPipe response headers…', 'Debug'); // Check that Cache-Control header set to "private". $this->assertSession()->responseHeaderContains('Cache-Control', 'private'); $this->assertEqual('no-store, content="BigPipe/1.0"', $this->drupalGetHeader('Surrogate-Control')); @@ -337,10 +338,10 @@ class BigPipeTest extends BrowserTestBase { * markup. */ protected function assertBigPipeNoJsPlaceholders(array $expected_big_pipe_nojs_placeholders) { - $this->pass('Verifying BigPipe no-JS placeholders & replacements…', 'Debug'); $this->assertSetsEqual(array_keys($expected_big_pipe_nojs_placeholders), array_map('rawurldecode', explode(' ', $this->drupalGetHeader('BigPipe-Test-No-Js-Placeholders')))); foreach ($expected_big_pipe_nojs_placeholders as $big_pipe_nojs_placeholder => $expected_replacement) { - $this->pass('Checking whether the replacement for the BigPipe no-JS placeholder "' . $big_pipe_nojs_placeholder . '" is present:'); + // Checking whether the replacement for the BigPipe no-JS placeholder + // $big_pipe_nojs_placeholder is present. $this->assertNoRaw($big_pipe_nojs_placeholder); if ($expected_replacement !== NULL) { $this->assertRaw($expected_replacement); @@ -358,12 +359,10 @@ class BigPipeTest extends BrowserTestBase { * defined in the order that they are expected to be rendered & streamed. */ protected function assertBigPipePlaceholders(array $expected_big_pipe_placeholders, array $expected_big_pipe_placeholder_stream_order) { - $this->pass('Verifying BigPipe placeholders & replacements…', 'Debug'); $this->assertSetsEqual(array_keys($expected_big_pipe_placeholders), explode(' ', $this->drupalGetHeader('BigPipe-Test-Placeholders'))); $placeholder_positions = []; $placeholder_replacement_positions = []; foreach ($expected_big_pipe_placeholders as $big_pipe_placeholder_id => $expected_ajax_response) { - $this->pass('BigPipe placeholder: ' . $big_pipe_placeholder_id, 'Debug'); // Verify expected placeholder. $expected_placeholder_html = ''; $this->assertRaw($expected_placeholder_html, 'BigPipe placeholder for placeholder ID "' . $big_pipe_placeholder_id . '" found.'); @@ -396,14 +395,15 @@ class BigPipeTest extends BrowserTestBase { $this->assertSetsEqual(array_keys($expected_big_pipe_placeholders_with_replacements), array_values($placeholder_replacement_positions)); $this->assertSame(count($expected_big_pipe_placeholders_with_replacements), preg_match_all('/' . preg_quote('