diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2018-08-13 00:48:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-13 00:48:27 +0300 |
commit | 73bc38f81454b78b1f844ea3ffbd9681117064de (patch) | |
tree | 2450c0ae4e7c7e6da331af3738ea9fe0c7969566 /tests/resources | |
parent | eb035eb9ebbf794c852ca0707423cb8ab3543aa8 (diff) |
Add backtrace to exceptions treated as fatal errors w/ test, … (#13276)
* Add backtrace to exceptions treated as fatal errors w/ test, and move partial backtrace reconstruction to FrontController so different safemodes can receive it.
* Add missing file.
* fixing tests
* fix test finally
* fix submodule
Diffstat (limited to 'tests/resources')
-rw-r--r-- | tests/resources/trigger-fatal-exception.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/resources/trigger-fatal-exception.php b/tests/resources/trigger-fatal-exception.php new file mode 100644 index 0000000000..a725553414 --- /dev/null +++ b/tests/resources/trigger-fatal-exception.php @@ -0,0 +1,31 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +define('PIWIK_PRINT_ERROR_BACKTRACE', true); +define('PIWIK_ENABLE_DISPATCH', false); + +require_once __DIR__ . '/../../tests/PHPUnit/proxy/index.php'; + +$environment = new \Piwik\Application\Environment(null); +$environment->init(); + +\Piwik\Access::getInstance()->setSuperUserAccess(true); + +$executed = false; +\Piwik\Piwik::addAction('Request.dispatch', function () use (&$executed) { + if (!$executed) { + $executed = true; + throw new Twig_Error_Runtime('test message'); + } +}); + +\Piwik\FrontController::$enableDispatch = true; + +\Piwik\FrontController::getInstance()->init(); + +echo \Piwik\FrontController::getInstance()->dispatch('CoreHome', 'index'); |