Mercurial > hg > cmmr2012-drupal-site
comparison vendor/symfony/phpunit-bridge/bootstrap.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
1 <?php | |
2 | |
3 /* | |
4 * This file is part of the Symfony package. | |
5 * | |
6 * (c) Fabien Potencier <fabien@symfony.com> | |
7 * | |
8 * For the full copyright and license information, please view the LICENSE | |
9 * file that was distributed with this source code. | |
10 */ | |
11 | |
12 use Doctrine\Common\Annotations\AnnotationRegistry; | |
13 use Symfony\Bridge\PhpUnit\DeprecationErrorHandler; | |
14 | |
15 // Detect if we need to serialize deprecations to a file. | |
16 if ($file = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) { | |
17 DeprecationErrorHandler::collectDeprecations($file); | |
18 | |
19 return; | |
20 } | |
21 | |
22 // Detect if we're loaded by an actual run of phpunit | |
23 if (!defined('PHPUNIT_COMPOSER_INSTALL') && !class_exists('PHPUnit_TextUI_Command', false) && !class_exists('PHPUnit\TextUI\Command', false)) { | |
24 return; | |
25 } | |
26 | |
27 // Enforce a consistent locale | |
28 setlocale(LC_ALL, 'C'); | |
29 | |
30 if (!class_exists('Doctrine\Common\Annotations\AnnotationRegistry', false) && class_exists('Doctrine\Common\Annotations\AnnotationRegistry')) { | |
31 if (method_exists('Doctrine\Common\Annotations\AnnotationRegistry', 'registerUniqueLoader')) { | |
32 AnnotationRegistry::registerUniqueLoader('class_exists'); | |
33 } else { | |
34 AnnotationRegistry::registerLoader('class_exists'); | |
35 } | |
36 } | |
37 | |
38 if ('disabled' !== getenv('SYMFONY_DEPRECATIONS_HELPER')) { | |
39 DeprecationErrorHandler::register(getenv('SYMFONY_DEPRECATIONS_HELPER')); | |
40 } |