diff options
Diffstat (limited to 'modules/simpletest/tests/error.test')
-rw-r--r-- | modules/simpletest/tests/error.test | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/simpletest/tests/error.test b/modules/simpletest/tests/error.test index cd648e12b..fe4ee4526 100644 --- a/modules/simpletest/tests/error.test +++ b/modules/simpletest/tests/error.test @@ -46,7 +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, 'Received expected HTTP status code.'); + $this->assertResponse(200, t('Received expected HTTP status code.')); $this->assertErrorMessage($error_notice); $this->assertErrorMessage($error_warning); $this->assertErrorMessage($error_user_notice); @@ -54,7 +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, 'Received expected HTTP status code.'); + $this->assertResponse(200, t('Received expected HTTP status code.')); $this->assertNoErrorMessage($error_notice); $this->assertErrorMessage($error_warning); $this->assertErrorMessage($error_user_notice); @@ -62,7 +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, 'Received expected HTTP status code.'); + $this->assertResponse(200, t('Received expected HTTP status code.')); $this->assertNoErrorMessage($error_notice); $this->assertNoErrorMessage($error_warning); $this->assertNoErrorMessage($error_user_notice); @@ -88,17 +88,17 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase { ); $this->drupalGet('error-test/trigger-exception'); - $this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), 'Received expected HTTP status line.'); + $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)'), 'Received expected HTTP status line.'); + $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'], 'Found ' . $error_pdo_exception['%type'] . ' in error page.'); - $this->assertText($error_pdo_exception['%message'], 'Found ' . $error_pdo_exception['%message'] . ' in error page.'); + $this->assertText($error_pdo_exception['%type'], t('Found %type in error page.', $error_pdo_exception)); + $this->assertText($error_pdo_exception['%message'], t('Found %message in error page.', $error_pdo_exception)); $error_details = t('in %function (line %line of %file)', $error_pdo_exception); - $this->assertRaw($error_details, "Found '" . $error_details . "' in error page."); + $this->assertRaw($error_details, t("Found '!message' in error page.", array('!message' => $error_details))); } /** @@ -106,7 +106,7 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase { */ function assertErrorMessage(array $error) { $message = t('%type: %message in %function (line %line of %file).', $error); - $this->assertRaw($message, 'Error ' . $message . ' found.'); + $this->assertRaw($message, t('Error !message found.', array('!message' => $message))); } /** @@ -114,7 +114,7 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase { */ function assertNoErrorMessage(array $error) { $message = t('%type: %message in %function (line %line of %file).', $error); - $this->assertNoRaw($message, 'Error ' . $message . ' not found.'); + $this->assertNoRaw($message, t('Error !message not found.', array('!message' => $message))); } } |