File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Test DeprecationErrorHandler in weak mode
3
+ --FILE--
4
+ <?php
5
+
6
+ putenv ('SYMFONY_DEPRECATIONS_HELPER=/foo/ ' );
7
+ putenv ('ANSICON ' );
8
+ putenv ('ConEmuANSI ' );
9
+ putenv ('TERM ' );
10
+
11
+ $ vendor = __DIR__ ;
12
+ while (!file_exists ($ vendor .'/vendor ' )) {
13
+ $ vendor = dirname ($ vendor );
14
+ }
15
+ define ('PHPUNIT_COMPOSER_INSTALL ' , $ vendor .'/vendor/autoload.php ' );
16
+ require PHPUNIT_COMPOSER_INSTALL ;
17
+ require_once __DIR__ .'/../../bootstrap.php ' ;
18
+
19
+ @trigger_error ('root deprecation ' , E_USER_DEPRECATED );
20
+
21
+ class FooTestCase
22
+ {
23
+ public function testLegacyFoo ()
24
+ {
25
+ @trigger_error ('silenced foo deprecation ' , E_USER_DEPRECATED );
26
+ trigger_error ('unsilenced foo deprecation ' , E_USER_DEPRECATED );
27
+ }
28
+ }
29
+
30
+ $ foo = new FooTestCase ();
31
+ $ foo ->testLegacyFoo ();
32
+
33
+ ?>
34
+ --EXPECTF--
35
+ Legacy deprecation triggered by FooTestCase::testLegacyFoo:
36
+ silenced foo deprecation
37
+ Stack trace:
38
+ #%A(%d): FooTestCase->testLegacyFoo()
39
+ #%d {main}
40
+
You can’t perform that action at this time.
0 commit comments