summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-11-05 17:06:18 +0000
committerDries Buytaert <dries@buytaert.net>2008-11-05 17:06:18 +0000
commit57d35b7fb18619cb68e405f586471ea0ac1453fe (patch)
tree8aa00621a010ca8f522185543b5a43c648b9bffa /modules/simpletest/tests
parentdc1af5e2909258358348a17b17a3f87850396e32 (diff)
downloadbrdo-57d35b7fb18619cb68e405f586471ea0ac1453fe.tar.gz
brdo-57d35b7fb18619cb68e405f586471ea0ac1453fe.tar.bz2
- Patch #243532 by Damien Tournoud et al: catch notices, warnings and fatal errors during testing. Woop, woop.
Diffstat (limited to 'modules/simpletest/tests')
-rw-r--r--modules/simpletest/tests/session_test.module7
-rw-r--r--modules/simpletest/tests/system_test.module3
2 files changed, 9 insertions, 1 deletions
diff --git a/modules/simpletest/tests/session_test.module b/modules/simpletest/tests/session_test.module
index 42c47a08c..b183ec38c 100644
--- a/modules/simpletest/tests/session_test.module
+++ b/modules/simpletest/tests/session_test.module
@@ -33,7 +33,12 @@ function session_test_menu() {
* Page callback, prints the stored session value to the screen.
*/
function _session_test_get() {
- return t('The current value of the stored session variable is: %val', array('%val' => $_SESSION['session_test_value']));
+ if (!empty($_SESSION['session_test_value'])) {
+ return t('The current value of the stored session variable is: %val', array('%val' => $_SESSION['session_test_value']));
+ }
+ else {
+ return "";
+ }
}
/**
diff --git a/modules/simpletest/tests/system_test.module b/modules/simpletest/tests/system_test.module
index bd3eff6c5..2134359d2 100644
--- a/modules/simpletest/tests/system_test.module
+++ b/modules/simpletest/tests/system_test.module
@@ -146,6 +146,7 @@ function system_test_modules_uninstalled($modules) {
* Menu callback; generate warnings to test the error handler.
*/
function system_test_generate_warnings() {
+ define('SIMPLETEST_DONT_COLLECT_ERRORS', TRUE);
// This will generate a notice.
$monkey_love = $bananas;
// This will generate a warning.
@@ -159,6 +160,7 @@ function system_test_generate_warnings() {
* Menu callback; trigger an exception to test the exception handler.
*/
function system_test_trigger_exception() {
+ define('SIMPLETEST_DONT_COLLECT_ERRORS', TRUE);
throw new Exception("Drupal is awesome");
}
@@ -166,5 +168,6 @@ function system_test_trigger_exception() {
* Menu callback; trigger an exception to test the exception handler.
*/
function system_test_trigger_pdo_exception() {
+ define('SIMPLETEST_DONT_COLLECT_ERRORS', TRUE);
db_query("SELECT * FROM bananas_are_awesome");
}