Skip to content
Snippets Groups Projects
Commit 1c9842d1 authored by catch's avatar catch
Browse files

Issue #3088369 by mikelutz, alexpott, Berdir, Gábor Hojtsy, andypost,...

Issue #3088369 by mikelutz, alexpott, Berdir, Gábor Hojtsy, andypost, martin107, greg.1.anderson, dawehner, jibran, Wim Leers, Mile23, catch: Update Drupal 9 to Symfony 4.4-dev
parent 1aaa1d95
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -19,30 +19,30 @@
"ext-xml": "*",
"php": ">=7.2.3",
"symfony/class-loader": "~3.4.0",
"symfony/console": "~3.4.0",
"symfony/dependency-injection": "~3.4.26",
"symfony/event-dispatcher": "~3.4.0",
"symfony/http-foundation": "~3.4.27",
"symfony/http-kernel": "~3.4.14",
"symfony/routing": "~3.4.0",
"symfony/serializer": "~3.4.0",
"symfony/translation": "~3.4.0",
"symfony/validator": "~3.4.0",
"symfony/process": "~3.4.0",
"symfony/console": "^4.4",
"symfony/dependency-injection": "^4.4",
"symfony/event-dispatcher": "^4.4",
"symfony/http-foundation": "^4.4",
"symfony/http-kernel": "^4.4",
"symfony/routing": "^4.4",
"symfony/serializer": "^4.4",
"symfony/translation": "^4.4",
"symfony/validator": "^4.4",
"symfony/process": "^4.4",
"symfony/polyfill-iconv": "^1.0",
"symfony/yaml": "~3.4.5",
"symfony/yaml": "^4.4",
"typo3/phar-stream-wrapper": "^3.1.2",
"twig/twig": "^1.38.2",
"doctrine/common": "^2.7",
"doctrine/annotations": "^1.4",
"guzzlehttp/guzzle": "^6.3",
"symfony-cmf/routing": "^1.4",
"symfony-cmf/routing": "^2.1",
"easyrdf/easyrdf": "^0.9",
"zendframework/zend-feed": "^2.12",
"stack/builder": "^1.0",
"egulias/email-validator": "^2.0",
"masterminds/html5": "^2.1",
"symfony/psr-http-message-bridge": "^1.1.2",
"symfony/psr-http-message-bridge": "^1.2.0",
"zendframework/zend-diactoros": ">=1.7 <1.8",
"composer/semver": "^1.0",
"asm89/stack-cors": "^1.1",
......
......@@ -12,7 +12,7 @@
},
"require": {
"php": ">=7.2.3",
"symfony/dependency-injection": ">=3.4 <4.0.0"
"symfony/dependency-injection": "^4.4"
},
"suggest": {
"symfony/expression-language": "For using expressions in service container configuration"
......
......@@ -6,8 +6,8 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.2.3",
"symfony/dependency-injection": ">=3.4 <4.0.0",
"symfony/event-dispatcher": ">=3.4 <4.0.0"
"symfony/dependency-injection": "^4.4",
"symfony/event-dispatcher": "^4.4"
},
"autoload": {
"psr-4": {
......
......@@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.2.3",
"symfony/http-foundation": ">=3.4 <4.0.0"
"symfony/http-foundation": "^4.4"
},
"autoload": {
"psr-4": {
......
......@@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.2.3",
"symfony/validator": ">=3.4 <4.0.0"
"symfony/validator": "^4.4"
},
"autoload": {
"psr-4": {
......
......@@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.2.3",
"symfony/yaml": ">=3.4 <4.0.0"
"symfony/yaml": "^4.4"
},
"autoload": {
"psr-4": {
......
......@@ -708,7 +708,7 @@ protected function curlHeaderCallback($curlHandler, $header) {
if (getenv('SYMFONY_DEPRECATIONS_HELPER') !== 'disabled') {
$message = (string) $parameters[0];
$test_info = TestDiscovery::getTestInfo(get_called_class());
if (!in_array('legacy', $test_info['groups']) && !in_array($message, DeprecationListenerTrait::getSkippedDeprecations())) {
if (!in_array('legacy', $test_info['groups']) && !DeprecationListenerTrait::isDeprecationSkipped($message)) {
call_user_func_array([&$this, 'error'], $parameters);
}
}
......
......@@ -38,13 +38,18 @@ public function setUp() {
'pass_raw' => $this->randomMachineName(),
]);
// If any $settings are defined for this test, copy and prepare an actual
// settings.php, so as to resemble a regular installation.
if (!empty($this->settings)) {
// Not using File API; a potential error must trigger a PHP warning.
copy(DRUPAL_ROOT . '/sites/default/default.settings.php', DRUPAL_ROOT . '/' . $this->siteDirectory . '/settings.php');
$this->writeSettings($this->settings);
}
// Create a regular settings.php for testing.
$this->prepareSettings();
// @todo Using the APCu file cache causes problems in this test when
// combined with Symfony 4.4. This seems to be a memory issue caused by
// excessive deprecation errors caused by
// https://github.com/symfony/symfony/commit/7c01c4c80c69159b2b39ea8bc53431196d7b29fb
// The deprecations will be fixed in https://www.drupal.org/project/drupal/issues/3074585
$settings['settings']['file_cache']['file_cache_disable'] = (object) [
'value' => TRUE,
'required' => TRUE,
];
$this->writeSettings($settings);
// Note that FunctionalTestSetupTrait::installParameters() returns form
// input values suitable for a programmed
......
......@@ -69,7 +69,7 @@ protected function deprecationEndTest($test, $time) {
$deprecations = $deprecations ? unserialize($deprecations) : [];
$resave = FALSE;
foreach ($deprecations as $key => $deprecation) {
if (in_array($deprecation[1], static::getSkippedDeprecations())) {
if (static::isDeprecationSkipped($deprecation[1])) {
unset($deprecations[$key]);
$resave = TRUE;
}
......@@ -100,6 +100,28 @@ private function willBeIsolated($test) {
return $r->getValue($test);
}
/**
* Determines if a deprecation error should be skipped.
*
* @return bool
* TRUE if the deprecation error should be skipped, FALSE if not.
*/
public static function isDeprecationSkipped($message) {
if (in_array($message, static::getSkippedDeprecations(), TRUE)) {
return TRUE;
}
$dynamic_skipped_deprecations = [
'%The "[^"]+" class extends "Symfony\\\\Component\\\\EventDispatcher\\\\Event" that is deprecated since Symfony 4\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead\.$%',
'%The "Symfony\\\\Component\\\\Routing\\\\(Compiled)?Route::(un)?serialize\(\)" method is considered (final|internal) since Symfony 4\.3\. It may change without further notice( as of its next major version)?\. You should not extend it from "[^"]+"\.%',
'%The "Symfony\\\\Component\\\\Validator\\\\Context\\\\ExecutionContextInterface::.*\(\)" method is considered internal Used by the validator engine. Should not be called by user\s\*\s*code\. It may change without further notice\. You should not extend it from "[^"]+".%',
'%Non-object services are deprecated since Symfony 4\.4, please fix the ".*" service which is of type ".*" right now\.%',
'%Non-object services are deprecated since Symfony 4\.4, setting the ".*" service to a value of type ".*" should be avoided\.%',
'%The ".*" service relies on the deprecated "Symfony\\\\Component\\\\Debug\\\\BufferingLogger" class\. It should either be deprecated or its implementation upgraded\.%',
'%Method ".*::.*\(\)" will return ".*" as of its next major version\. Doing the same in child class ".*" will be required when upgrading\.%',
];
return (bool) preg_filter($dynamic_skipped_deprecations, '$0', $message);
}
/**
* A list of deprecations to ignore whilst fixes are put in place.
*
......@@ -134,12 +156,36 @@ public static function getSkippedDeprecations() {
'\Drupal\Tests\SkippedDeprecationTest deprecation',
// These deprecations are triggered by symfony/psr-http-message-factory
// 1.2, which can be installed if you update dependencies on php 7 or
// higher
// higher.
'The "Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory" class is deprecated since symfony/psr-http-message-bridge 1.2, use PsrHttpFactory instead.',
'The "psr7.http_message_factory" service relies on the deprecated "Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory" class. It should either be deprecated or its implementation upgraded.',
// This deprecation comes from behat/mink-browserkit-driver when updating
// symfony/browser-kit to 4.3+.
'The "Symfony\Component\BrowserKit\Response::getStatus()" method is deprecated since Symfony 4.3, use getStatusCode() instead.',
// The following deprecations are introduced in by the new
// DebugClassLoader in Symfony 4 we cannot immediately fix them without
// breaking backwards compatibility.
// @see https://www.drupal.org/project/drupal/issues/3030494
// @see https://www.drupal.org/project/drupal/issues/3030474
'The "Drupal\Core\Template\Loader\StringLoader" class implements "Twig\Loader\ExistsLoaderInterface" that is deprecated since 1.12 (to be removed in 3.0).',
'The "Drupal\Core\Template\Loader\StringLoader" class implements "Twig\Loader\SourceContextLoaderInterface" that is deprecated since 1.27 (to be removed in 3.0).',
// The following Symfony deprecations are introduced in the Symfony 4
// development cycle. They will need to be resolved prior to Symfony 5
// compatibility.
'Support for mapping keys in multi-line blocks is deprecated since Symfony 4.3 and will throw a ParseException in 5.0.',
'The "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser" class is deprecated since Symfony 4.3, use "Symfony\Component\Mime\MimeTypes" instead.',
'The "Drupal\Core\File\MimeType\MimeTypeGuesser" class implements "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface" that is deprecated since Symfony 4.3, use {@link MimeTypesInterface} instead.',
'The "Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser" class is deprecated since Symfony 4.3, use "Symfony\Component\Mime\FileBinaryMimeTypeGuesser" instead.',
'The "Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser" class is deprecated since Symfony 4.3, use "Symfony\Component\Mime\FileinfoMimeTypeGuesser" instead.',
'The signature of the "Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch()" method should be updated to "dispatch($event, string $eventName = null)", not doing so is deprecated since Symfony 4.3.',
'Calling the "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" method with the event name as the first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead.',
'The "Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch()" method will require a new "string|null $eventName" argument in the next major version of its parent class "Symfony\Contracts\EventDispatcher\EventDispatcherInterface", not defining it is deprecated.',
'The "Goutte\Client" class extends "Symfony\Component\BrowserKit\Client" that is deprecated since Symfony 4.3, use "\Symfony\Component\BrowserKit\AbstractBrowser" instead.',
'Passing a command as string when creating a "Symfony\Component\Process\Process" instance is deprecated since Symfony 4.2, pass it as an array of its arguments instead, or use the "Process::fromShellCommandline()" constructor if you need features provided by the shell.',
'Passing arguments to "Symfony\Component\HttpFoundation\Request::isMethodSafe()" has been deprecated since Symfony 4.4; use "Symfony\Component\HttpFoundation\Request::isMethodCacheable()" to check if the method is cacheable instead.',
'The "Symfony\Component\Process\Process::inheritEnvironmentVariables()" method is deprecated since Symfony 4.4, env variables are always inherited.',
'The "Symfony\Component\Debug\BufferingLogger" class is deprecated since Symfony 4.4, use "Symfony\Component\ErrorHandler\BufferingLogger" instead.',
'Using the "Symfony\Component\Validator\Constraints\Length" constraint with the "min" option without setting the "allowEmptyString" one is deprecated and defaults to true. In 5.0, it will become optional and default to false.',
'The "core/jquery.ui.checkboxradio" asset library is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. See https://www.drupal.org/node/3067969',
'The "core/jquery.ui.controlgroup" asset library is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. See https://www.drupal.org/node/3067969',
// @todo Remove in https://www.drupal.org/project/drupal/issues/3082655
......@@ -159,7 +205,7 @@ public static function getSkippedDeprecations() {
protected function registerErrorHandler($test) {
$deprecation_handler = function ($type, $msg, $file, $line, $context = []) {
// Skip listed deprecations.
if ($type === E_USER_DEPRECATED && in_array($msg, self::getSkippedDeprecations(), TRUE)) {
if ($type === E_USER_DEPRECATED && static::isDeprecationSkipped($msg)) {
return;
}
return call_user_func($this->previousHandler, $type, $msg, $file, $line, $context);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment