-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #5: do not panic if previous error handler returns null
- Loading branch information
Showing
9 changed files
with
442 additions
and
381 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,15 @@ | ||
--TEST-- | ||
ErrorHandler - Test User Error does throw Error | ||
--FILE-- | ||
<?php | ||
|
||
use Kcs\ClassFinder\Util\ErrorHandler; | ||
|
||
require __DIR__ . '/../../vendor/autoload.php'; | ||
|
||
ErrorHandler::register(); | ||
trigger_error('This is an error', E_USER_ERROR); | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught Kcs\ClassFinder\Util\Error: This is an error in %a |
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,15 @@ | ||
--TEST-- | ||
ErrorHandler - Test User Notice does not throw Error | ||
--FILE-- | ||
<?php | ||
|
||
use Kcs\ClassFinder\Util\ErrorHandler; | ||
|
||
require __DIR__ . '/../../vendor/autoload.php'; | ||
|
||
ErrorHandler::register(); | ||
trigger_error('This is a notice', E_USER_NOTICE); | ||
|
||
?> | ||
--EXPECTF-- | ||
Notice: This is a notice in %a |
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,15 @@ | ||
--TEST-- | ||
ErrorHandler - Test User Warning does not throw Error | ||
--FILE-- | ||
<?php | ||
|
||
use Kcs\ClassFinder\Util\ErrorHandler; | ||
|
||
require __DIR__ . '/../../vendor/autoload.php'; | ||
|
||
ErrorHandler::register(); | ||
trigger_error('This is a warning', E_USER_WARNING); | ||
|
||
?> | ||
--EXPECTF-- | ||
Warning: This is a warning in %a |
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,17 @@ | ||
--TEST-- | ||
ErrorHandler - Test User Notice does not panic if previous handler returns void | ||
--FILE-- | ||
<?php | ||
|
||
use Kcs\ClassFinder\Util\ErrorHandler; | ||
|
||
require __DIR__ . '/../../vendor/autoload.php'; | ||
|
||
set_error_handler(static function (): void {}); | ||
|
||
ErrorHandler::register(); | ||
trigger_error('This is a notice', E_USER_NOTICE); | ||
|
||
?> | ||
--EXPECTF-- | ||
Notice: This is a notice in %a |