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 50e1445

Browse filesBrowse files
[Bridge\PhpUnit] Add Tests/DeprecationErrorHandler/regexp.phpt
1 parent 4281501 commit 50e1445
Copy full SHA for 50e1445

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.