Commit 843a7cf3 authored by Dries's avatar Dries

- Patch #1064264 by rfray: get the tests ready for the Great Git Migration.

parent 8813c4cc
...@@ -25,21 +25,18 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase { ...@@ -25,21 +25,18 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
'%type' => 'Notice', '%type' => 'Notice',
'!message' => 'Undefined variable: bananas', '!message' => 'Undefined variable: bananas',
'%function' => 'error_test_generate_warnings()', '%function' => 'error_test_generate_warnings()',
'%line' => 44,
'%file' => drupal_realpath('modules/simpletest/tests/error_test.module'), '%file' => drupal_realpath('modules/simpletest/tests/error_test.module'),
); );
$error_warning = array( $error_warning = array(
'%type' => 'Warning', '%type' => 'Warning',
'!message' => 'Division by zero', '!message' => 'Division by zero',
'%function' => 'error_test_generate_warnings()', '%function' => 'error_test_generate_warnings()',
'%line' => 46,
'%file' => drupal_realpath('modules/simpletest/tests/error_test.module'), '%file' => drupal_realpath('modules/simpletest/tests/error_test.module'),
); );
$error_user_notice = array( $error_user_notice = array(
'%type' => 'User warning', '%type' => 'User warning',
'!message' => 'Drupal is awesome', '!message' => 'Drupal is awesome',
'%function' => 'error_test_generate_warnings()', '%function' => 'error_test_generate_warnings()',
'%line' => 48,
'%file' => drupal_realpath('modules/simpletest/tests/error_test.module'), '%file' => drupal_realpath('modules/simpletest/tests/error_test.module'),
); );
...@@ -97,7 +94,7 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase { ...@@ -97,7 +94,7 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
// varies from database to database. Check that the SQL string is displayed. // 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)); $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)); $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); $error_details = t('in %function (line ', $error_pdo_exception);
$this->assertRaw($error_details, t("Found '!message' in error page.", array('!message' => $error_details))); $this->assertRaw($error_details, t("Found '!message' in error page.", array('!message' => $error_details)));
} }
...@@ -105,16 +102,16 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase { ...@@ -105,16 +102,16 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
* Helper function: assert that the error message is found. * Helper function: assert that the error message is found.
*/ */
function assertErrorMessage(array $error) { function assertErrorMessage(array $error) {
$message = t('%type: !message in %function (line %line of %file).', $error); $message = t('%type: !message in %function (line ', $error);
$this->assertRaw($message, t('Error !message found.', array('!message' => $message))); $this->assertRaw($message, t('Found error message: !message.', array('!message' => $message)));
} }
/** /**
* Helper function: assert that the error message is not found. * Helper function: assert that the error message is not found.
*/ */
function assertNoErrorMessage(array $error) { function assertNoErrorMessage(array $error) {
$message = t('%type: !message in %function (line %line of %file).', $error); $message = t('%type: !message in %function (line ', $error);
$this->assertNoRaw($message, t('Error !message not found.', array('!message' => $message))); $this->assertNoRaw($message, t('Did not find error message: !message.', array('!message' => $message)));
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment