Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / lib / Drupal / Core / Test / HttpClientMiddleware / TestHttpClientMiddleware.php
index 3c4d1427a82b92fbd5233512248e4cfc0d96a8c1..ecb629316e9fa9c40848782411d22a7a28a905ae 100644 (file)
@@ -41,7 +41,15 @@ class TestHttpClientMiddleware {
                   // the header.
                   $parameters = unserialize(urldecode($header_value));
                   if (count($parameters) === 3) {
-                    throw new \Exception($parameters[1] . ': ' . $parameters[0] . "\n" . Error::formatBacktrace([$parameters[2]]));
+                    if ($parameters[1] === 'User deprecated function') {
+                      // Fire the same deprecation message to allow it to be
+                      // collected by
+                      // \Symfony\Bridge\PhpUnit\DeprecationErrorHandler::collectDeprecations().
+                      @trigger_error((string) $parameters[0], E_USER_DEPRECATED);
+                    }
+                    else {
+                      throw new \Exception($parameters[1] . ': ' . $parameters[0] . "\n" . Error::formatBacktrace([$parameters[2]]));
+                    }
                   }
                   else {
                     throw new \Exception('Error thrown with the wrong amount of parameters.');