-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debugger::enable(): exit() replaced with _exceptionHandler()
- Loading branch information
Showing
6 changed files
with
105 additions
and
21 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
17 changes: 17 additions & 0 deletions
17
tests/Tracy/Debugger.enable().error.development.console.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,17 @@ | ||
<?php | ||
|
||
/** | ||
* Test: Tracy\Debugger::enable() error. | ||
* @exitCode 254 | ||
* @httpCode 500 | ||
* @outputMatch exception 'RuntimeException' with message%A% | ||
*/ | ||
|
||
use Tracy\Debugger; | ||
|
||
|
||
require __DIR__ . '/../bootstrap.php'; | ||
|
||
header('Content-Type: text/plain'); | ||
|
||
Debugger::enable(Debugger::DEVELOPMENT, 'relative'); |
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,19 @@ | ||
<?php | ||
|
||
/** | ||
* Test: Tracy\Debugger::enable() error. | ||
* @exitCode 254 | ||
* @httpCode 500 | ||
* @outputMatch %A%<title>RuntimeException</title><!-- Log directory is not found or is not directory. -->%A% | ||
*/ | ||
|
||
use Tracy\Debugger; | ||
|
||
|
||
require __DIR__ . '/../bootstrap.php'; | ||
|
||
if (PHP_SAPI === 'cli') { | ||
Tester\Environment::skip('HTML is not rendered in CLI mode'); | ||
} | ||
|
||
Debugger::enable(Debugger::DEVELOPMENT, 'relative'); |
17 changes: 17 additions & 0 deletions
17
tests/Tracy/Debugger.enable().error.production.console.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,17 @@ | ||
<?php | ||
|
||
/** | ||
* Test: Tracy\Debugger::enable() error. | ||
* @exitCode 254 | ||
* @httpCode 500 | ||
* @outputMatch ERROR: application encountered an error and can not continue. | ||
*/ | ||
|
||
use Tracy\Debugger; | ||
|
||
|
||
require __DIR__ . '/../bootstrap.php'; | ||
|
||
header('Content-Type: text/plain'); | ||
|
||
Debugger::enable(Debugger::PRODUCTION, 'relative'); |
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,19 @@ | ||
<?php | ||
|
||
/** | ||
* Test: Tracy\Debugger::enable() error. | ||
* @exitCode 254 | ||
* @httpCode 500 | ||
* @outputMatch %A%<title>Server Error</title>%A% | ||
*/ | ||
|
||
use Tracy\Debugger; | ||
|
||
|
||
require __DIR__ . '/../bootstrap.php'; | ||
|
||
if (PHP_SAPI === 'cli') { | ||
Tester\Environment::skip('HTML is not rendered in CLI mode'); | ||
} | ||
|
||
Debugger::enable(Debugger::PRODUCTION, 'relative'); |
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,21 @@ | ||
<?php | ||
|
||
/** | ||
* Test: Tracy\Debugger logging error. | ||
*/ | ||
|
||
use Tracy\Debugger, | ||
Tester\Assert; | ||
|
||
|
||
require __DIR__ . '/../bootstrap.php'; | ||
|
||
|
||
// no error | ||
Debugger::$logDirectory = TEMP_DIR; | ||
Debugger::log('Hello'); | ||
|
||
Debugger::$logDirectory = TEMP_DIR . '/unknown'; | ||
Assert::exception(function() { | ||
Debugger::log('Hello'); | ||
}, 'RuntimeException', "Directory '%a%' is not found or is not directory."); |