-
-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to fix #552 allowing all fatals to be captured; add regression PH…
…PT test (#571)
- Loading branch information
Showing
3 changed files
with
30 additions
and
9 deletions.
There are no files selected for viewing
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
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
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,30 @@ | ||
--TEST-- | ||
Test that, when handling a fatal, we report it once and only once | ||
--FILE-- | ||
<?php | ||
|
||
$vendor = __DIR__; | ||
while (!file_exists($vendor.'/vendor')) { | ||
$vendor = dirname($vendor); | ||
} | ||
require $vendor.'/test/bootstrap.php'; | ||
|
||
error_reporting(E_ALL); | ||
$client = new \Raven_Client(); | ||
set_error_handler(function () use ($client) { | ||
echo 'Previous error handler is called' . PHP_EOL; | ||
echo 'Error is ' . ($client->getLastEventID() !== null ? 'reported correctly' : 'NOT reported'); | ||
}); | ||
|
||
set_exception_handler(function () { | ||
echo 'This should not be called'; | ||
}); | ||
|
||
$client->install(); | ||
|
||
require 'inexistent_file.php'; | ||
?> | ||
--EXPECTF-- | ||
Previous error handler is called | ||
Error is reported correctly | ||
Fatal error: %a |