diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php index 50f62b9abcfef..fb3cd6130527e 100644 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php @@ -260,6 +260,8 @@ if ('\\' === \DIRECTORY_SEPARATOR) { file_put_contents('composer.json', preg_replace('/^( {8})"phpunit-bridge": \{$/m', "$0\n$1 ".'"options": {"symlink": false},', file_get_contents('composer.json'))); } + $phpunitBridgeComposerJson = file_get_contents($path.'/composer.json'); + file_put_contents($path.'/composer.json', preg_replace('/^( {8})"files": .*/m', '', $phpunitBridgeComposerJson)); } else { $passthruOrFail("$COMPOSER require --no-update symfony/phpunit-bridge \"*\""); } @@ -269,6 +271,9 @@ // --no-suggest is not in the list to keep compat with composer 1.0, which is shipped with Ubuntu 16.04LTS $exit = proc_close(proc_open("$q$COMPOSER install --no-dev --prefer-dist --no-progress $q", [], $p, getcwd())); putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : '')); + if (file_exists($path)) { + file_put_contents($path.'/composer.json', $phpunitBridgeComposerJson); + } if ($prevCacheDir) { putenv("COMPOSER_CACHE_DIR=$prevCacheDir"); } diff --git a/src/Symfony/Bridge/PhpUnit/bootstrap.php b/src/Symfony/Bridge/PhpUnit/bootstrap.php index f2064368f41a3..175d57b88688f 100644 --- a/src/Symfony/Bridge/PhpUnit/bootstrap.php +++ b/src/Symfony/Bridge/PhpUnit/bootstrap.php @@ -10,10 +10,11 @@ */ use Doctrine\Common\Annotations\AnnotationRegistry; +use Doctrine\Deprecations\Deprecation; use Symfony\Bridge\PhpUnit\DeprecationErrorHandler; // Detect if we need to serialize deprecations to a file. -if ($file = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) { +if (in_array(PHP_SAPI, ['cli', 'phpdbg'], true) && $file = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) { DeprecationErrorHandler::collectDeprecations($file); return; @@ -27,6 +28,10 @@ // Enforce a consistent locale setlocale(\LC_ALL, 'C'); +if (class_exists(Deprecation::class)) { + Deprecation::withoutDeduplication(); +} + if (!class_exists(AnnotationRegistry::class, false) && class_exists(AnnotationRegistry::class)) { if (method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) { AnnotationRegistry::registerUniqueLoader('class_exists');