summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/error.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-06-10 20:00:10 +0000
committerDries Buytaert <dries@buytaert.net>2009-06-10 20:00:10 +0000
commit05c39fe7a04607ed2fdb07c01f4e24de3c0f9056 (patch)
treea53ac9917e4a68c2dcd7fe9d0397d3fdda749581 /modules/simpletest/tests/error.test
parentd540553f21ea38cdd6dc7f8b3eb73d828668a9fa (diff)
downloadbrdo-05c39fe7a04607ed2fdb07c01f4e24de3c0f9056.tar.gz
brdo-05c39fe7a04607ed2fdb07c01f4e24de3c0f9056.tar.bz2
- Patch #487830 by c960657: fixed a HTTP header and improved the tests.
Diffstat (limited to 'modules/simpletest/tests/error.test')
-rw-r--r--modules/simpletest/tests/error.test5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/simpletest/tests/error.test b/modules/simpletest/tests/error.test
index ed430bfff..b98c38cc8 100644
--- a/modules/simpletest/tests/error.test
+++ b/modules/simpletest/tests/error.test
@@ -46,6 +46,7 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
// Set error reporting to collect notices.
variable_set('error_level', ERROR_REPORTING_DISPLAY_ALL);
$this->drupalGet('error-test/generate-warnings');
+ $this->assertResponse(200, t('Received expected HTTP status code.'));
$this->assertErrorMessage($error_notice);
$this->assertErrorMessage($error_warning);
$this->assertErrorMessage($error_user_notice);
@@ -53,6 +54,7 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
// Set error reporting to not collect notices.
variable_set('error_level', ERROR_REPORTING_DISPLAY_SOME);
$this->drupalGet('error-test/generate-warnings');
+ $this->assertResponse(200, t('Received expected HTTP status code.'));
$this->assertNoErrorMessage($error_notice);
$this->assertErrorMessage($error_warning);
$this->assertErrorMessage($error_user_notice);
@@ -60,6 +62,7 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
// Set error reporting to not show any errors.
variable_set('error_level', ERROR_REPORTING_HIDE);
$this->drupalGet('error-test/generate-warnings');
+ $this->assertResponse(200, t('Received expected HTTP status code.'));
$this->assertNoErrorMessage($error_notice);
$this->assertNoErrorMessage($error_warning);
$this->assertNoErrorMessage($error_user_notice);
@@ -85,9 +88,11 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
);
$this->drupalGet('error-test/trigger-exception');
+ $this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), t('Received expected HTTP status line.'));
$this->assertErrorMessage($error_exception);
$this->drupalGet('error-test/trigger-pdo-exception');
+ $this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), t('Received expected HTTP status line.'));
// We cannot use assertErrorMessage() since the extact error reported
// varies from database to database. Check that the SQL string is displayed.
$this->assertText($error_pdo_exception['%type'], t('Found %type in error page.', $error_pdo_exception));