-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test for custom error reporting
i.e. using different values for error_reporting and the Bugsnag `setErrorReportingLevel` option
- Loading branch information
1 parent
ef13190
commit cc4d24f
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...s/phpt/handler_should_respect_error_suppression_operator_with_custom_reporting_level.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--TEST-- | ||
Bugsnag\Handler should respect the error suppression operator with a custom reporting level | ||
--FILE-- | ||
<?php | ||
$client = require __DIR__ . '/_prelude.php'; | ||
$client->getConfig()->setErrorReportingLevel(E_ALL & ~E_USER_NOTICE); | ||
error_reporting(E_ALL & ~E_USER_WARNING); | ||
|
||
Bugsnag\Handler::register($client); | ||
|
||
echo "Triggering a user notice that should be reported by PHP and ignored by Bugsnag\n"; | ||
trigger_error('abc notice', E_USER_NOTICE); | ||
|
||
echo "Triggering a suppressed user notice that should be ignored by PHP and ignored by Bugsnag\n"; | ||
@trigger_error('xyz notice', E_USER_NOTICE); | ||
|
||
echo "Triggering a user warning that should be ignored by PHP and reported by Bugsnag\n"; | ||
trigger_error('abc warning', E_USER_WARNING); | ||
|
||
echo "Triggering a suppressed user warning that should be ignored by PHP and ignored by Bugsnag\n"; | ||
@trigger_error('xyz warning', E_USER_WARNING); | ||
?> | ||
--EXPECTF-- | ||
Triggering a user notice that should be reported by PHP and ignored by Bugsnag | ||
|
||
Notice: abc notice in %s on line 9 | ||
Triggering a suppressed user notice that should be ignored by PHP and ignored by Bugsnag | ||
Triggering a user warning that should be ignored by PHP and reported by Bugsnag | ||
Triggering a suppressed user warning that should be ignored by PHP and ignored by Bugsnag | ||
Guzzle request made (1 event)! | ||
* Method: 'POST' | ||
* URI: 'http://localhost/notify' | ||
* Events: | ||
- abc warning |