Mercurial > hg > isophonics-drupal-site
diff core/modules/simpletest/src/WebTestBase.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 7a779792577d |
children | c2387f117808 |
line wrap: on
line diff
--- a/core/modules/simpletest/src/WebTestBase.php Mon Apr 23 09:33:26 2018 +0100 +++ b/core/modules/simpletest/src/WebTestBase.php Mon Apr 23 09:46:53 2018 +0100 @@ -18,6 +18,7 @@ use Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait; use Drupal\Tests\EntityViewTrait; use Drupal\Tests\block\Traits\BlockCreationTrait as BaseBlockCreationTrait; +use Drupal\Tests\Listeners\DeprecationListenerTrait; use Drupal\Tests\node\Traits\ContentTypeCreationTrait; use Drupal\Tests\node\Traits\NodeCreationTrait; use Drupal\Tests\Traits\Core\CronRunTrait; @@ -692,9 +693,21 @@ // generated by _drupal_log_error() in the exact form required // by \Drupal\simpletest\WebTestBase::error(). if (preg_match('/^X-Drupal-Assertion-[0-9]+: (.*)$/', $header, $matches)) { - // Call \Drupal\simpletest\WebTestBase::error() with the parameters from - // the header. - call_user_func_array([&$this, 'error'], unserialize(urldecode($matches[1]))); + $parameters = unserialize(urldecode($matches[1])); + // Handle deprecation notices triggered by system under test. + if ($parameters[1] === 'User deprecated function') { + if (getenv('SYMFONY_DEPRECATIONS_HELPER') !== 'disabled') { + $message = (string) $parameters[0]; + if (!in_array($message, DeprecationListenerTrait::getSkippedDeprecations())) { + call_user_func_array([&$this, 'error'], $parameters); + } + } + } + else { + // Call \Drupal\simpletest\WebTestBase::error() with the parameters from + // the header. + call_user_func_array([&$this, 'error'], $parameters); + } } // Save cookies. @@ -819,7 +832,7 @@ * The result of the request. */ protected function drupalGetWithFormat($path, $format, array $options = [], array $headers = []) { - $options += ['query' => ['_format' => $format]]; + $options = array_merge_recursive(['query' => ['_format' => $format]], $options); return $this->drupalGet($path, $options, $headers); }