File tree Expand file tree Collapse file tree 4 files changed +79
-2
lines changed
src/Symfony/Bridge/PhpUnit
Tests/DeprecationErrorHandler Expand file tree Collapse file tree 4 files changed +79
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public function __construct()
4949 * Registers and configures the deprecation handler.
5050 *
5151 * The mode is a query string with options:
52- * - "disabled" to disable the deprecation handler
52+ * - "disabled" to enable/ disable the deprecation handler
5353 * - "verbose" to enable/disable displaying the deprecation report
5454 * - "max" to configure the number of deprecations to allow before exiting with a non-zero
5555 * status code; it's an array with keys "total", "self", "direct" and "indirect"
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ public static function fromUrlEncodedString($serializedConfiguration)
166166 }
167167 }
168168
169- if (isset ($ normalizedConfiguration ['disabled ' ])) {
169+ if (isset ($ normalizedConfiguration ['disabled ' ]) && ' 0 ' !== $ normalizedConfiguration [ ' disabled ' ] ) {
170170 return self ::inDisabledMode ();
171171 }
172172
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Test DeprecationErrorHandler in default mode
3+ --FILE--
4+ <?php
5+
6+ $ k = 'SYMFONY_DEPRECATIONS_HELPER ' ;
7+ putenv ($ k .'= ' .$ _SERVER [$ k ] = $ _ENV [$ k ] = 'disabled=0 ' );
8+ putenv ($ k );
9+ putenv ('ANSICON ' );
10+ putenv ('ConEmuANSI ' );
11+ putenv ('TERM ' );
12+
13+ $ vendor = __DIR__ ;
14+ while (!file_exists ($ vendor .'/vendor ' )) {
15+ $ vendor = dirname ($ vendor );
16+ }
17+ define ('PHPUNIT_COMPOSER_INSTALL ' , $ vendor .'/vendor/autoload.php ' );
18+ require PHPUNIT_COMPOSER_INSTALL ;
19+ require_once __DIR__ .'/../../bootstrap.php ' ;
20+
21+ @trigger_error ('root deprecation ' , E_USER_DEPRECATED );
22+
23+ eval (<<<'EOPHP'
24+ namespace PHPUnit\Util;
25+
26+ class Test
27+ {
28+ public static function getGroups()
29+ {
30+ return array();
31+ }
32+ }
33+ EOPHP
34+ );
35+ ?>
36+ --EXPECTF--
37+ Other deprecation notices (1)
38+
39+ 1x: root deprecation
40+
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Test DeprecationErrorHandler in default mode
3+ --FILE--
4+ <?php
5+
6+ $ k = 'SYMFONY_DEPRECATIONS_HELPER ' ;
7+ putenv ($ k .'= ' .$ _SERVER [$ k ] = $ _ENV [$ k ] = 'disabled=1 ' );
8+ putenv ($ k );
9+ putenv ('ANSICON ' );
10+ putenv ('ConEmuANSI ' );
11+ putenv ('TERM ' );
12+
13+ $ vendor = __DIR__ ;
14+ while (!file_exists ($ vendor .'/vendor ' )) {
15+ $ vendor = dirname ($ vendor );
16+ }
17+ define ('PHPUNIT_COMPOSER_INSTALL ' , $ vendor .'/vendor/autoload.php ' );
18+ require PHPUNIT_COMPOSER_INSTALL ;
19+ require_once __DIR__ .'/../../bootstrap.php ' ;
20+
21+ @trigger_error ('root deprecation ' , E_USER_DEPRECATED );
22+
23+ eval (<<<'EOPHP'
24+ namespace PHPUnit\Util;
25+
26+ class Test
27+ {
28+ public static function getGroups()
29+ {
30+ return array();
31+ }
32+ }
33+ EOPHP
34+ );
35+ ?>
36+ --EXPECTF--
37+
You can’t perform that action at this time.
0 commit comments