Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8fe02a8

Browse filesBrowse files
minor #18274 [Bridge\PhpUnit] Add Tests/DeprecationErrorHandler/regexp.phpt (nicolas-grekas)
This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #18274). Discussion ---------- [Bridge\PhpUnit] Add Tests/DeprecationErrorHandler/regexp.phpt | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 50e1445 [Bridge\PhpUnit] Add Tests/DeprecationErrorHandler/regexp.phpt
2 parents 4281501 + 50e1445 commit 8fe02a8
Copy full SHA for 8fe02a8

File tree

Expand file treeCollapse file tree

1 file changed

+40
-0
lines changed
Filter options
  • src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler
Expand file treeCollapse file tree

1 file changed

+40
-0
lines changed
+40Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.