diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index 43986a253d..1344ad0fc0 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -692,8 +692,7 @@ protected function curlHeaderCallback($curlHandler, $header) { // by \Drupal\simpletest\WebTestBase::error(). if (preg_match('/^X-Drupal-Assertion-[0-9]+: (.*)$/', $header, $matches)) { $parameters = unserialize(urldecode($matches[1])); - // Swallow deprecation notices. WebTestBase will not be updated to handle - // them. + // Handle deprecation notices triggered by system under test. if ($parameters[1] === 'User deprecated function') { $message = (string) $parameters[0]; if (!in_array($message, DeprecationListener::getSkippedDeprecations())) { diff --git a/core/tests/bootstrap.php b/core/tests/bootstrap.php index 165a8cc401..5114890e33 100644 --- a/core/tests/bootstrap.php +++ b/core/tests/bootstrap.php @@ -169,6 +169,9 @@ function drupal_phpunit_populate_class_loader() { Handle::register(); // Enable the collection of deprecation notices in isolated PHPUnit tests. -if ($ser = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) { - DeprecationErrorHandler::collectDeprecations($ser); +// We need to add this here because the assumptions made in +// vendor/symfony/phpunit-bridge/bootstrap.php are not true for Drupal. We set +// PHPUNIT_COMPOSER_INSTALL during isolated test runs. +if ($file = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) { + DeprecationErrorHandler::collectDeprecations($file); }