diff --git a/src/Pluf/Dispatcher.php b/src/Pluf/Dispatcher.php index 12e2bdd..d576ff5 100644 --- a/src/Pluf/Dispatcher.php +++ b/src/Pluf/Dispatcher.php @@ -75,6 +75,9 @@ class Pluf_Dispatcher $response = new Pluf_HTTP_Response_ServerError($e); } $response->render($req->method != 'HEAD' and !defined('IN_UNIT_TESTS')); + if (defined('IN_UNIT_TESTS')) { + throw $e; + } } /** * [signal] diff --git a/src/Pluf/Mail.php b/src/Pluf/Mail.php index 551f72c..741ccc6 100644 --- a/src/Pluf/Mail.php +++ b/src/Pluf/Mail.php @@ -194,5 +194,8 @@ class Pluf_Mail if (Pluf::f('send_emails', true)) { $mail->send($this->to_address, $hdrs, $body); } + if (defined('IN_UNIT_TESTS')) { + $GLOBALS['_PX_UNIT_TESTS']['emails'][] = array($this->to_address, $hdrs, $body); + } } }