Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
317
Merge Requests
317
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
843a7cf3
Commit
843a7cf3
authored
Feb 19, 2011
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#1064264
by rfray: get the tests ready for the Great Git Migration.
parent
8813c4cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
modules/simpletest/tests/error.test
modules/simpletest/tests/error.test
+5
-8
No files found.
modules/simpletest/tests/error.test
View file @
843a7cf3
...
...
@@ -25,21 +25,18 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
'%type'
=>
'Notice'
,
'!message'
=>
'Undefined variable: bananas'
,
'%function'
=>
'error_test_generate_warnings()'
,
'%line'
=>
44
,
'%file'
=>
drupal_realpath
(
'modules/simpletest/tests/error_test.module'
),
);
$error_warning
=
array
(
'%type'
=>
'Warning'
,
'!message'
=>
'Division by zero'
,
'%function'
=>
'error_test_generate_warnings()'
,
'%line'
=>
46
,
'%file'
=>
drupal_realpath
(
'modules/simpletest/tests/error_test.module'
),
);
$error_user_notice
=
array
(
'%type'
=>
'User warning'
,
'!message'
=>
'Drupal is awesome'
,
'%function'
=>
'error_test_generate_warnings()'
,
'%line'
=>
48
,
'%file'
=>
drupal_realpath
(
'modules/simpletest/tests/error_test.module'
),
);
...
...
@@ -97,7 +94,7 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
// 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
[
'!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
)));
}
...
...
@@ -105,16 +102,16 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
* Helper function: assert that the error message is found.
*/
function
assertErrorMessage
(
array
$error
)
{
$message
=
t
(
'%type: !message in %function (line
%line of %file).
'
,
$error
);
$this
->
assertRaw
(
$message
,
t
(
'
Error !message found
.'
,
array
(
'!message'
=>
$message
)));
$message
=
t
(
'%type: !message in %function (line '
,
$error
);
$this
->
assertRaw
(
$message
,
t
(
'
Found error message: !message
.'
,
array
(
'!message'
=>
$message
)));
}
/**
* Helper function: assert that the error message is not found.
*/
function
assertNoErrorMessage
(
array
$error
)
{
$message
=
t
(
'%type: !message in %function (line
%line of %file).
'
,
$error
);
$this
->
assertNoRaw
(
$message
,
t
(
'
Error !message not found
.'
,
array
(
'!message'
=>
$message
)));
$message
=
t
(
'%type: !message in %function (line '
,
$error
);
$this
->
assertNoRaw
(
$message
,
t
(
'
Did not find error message: !message
.'
,
array
(
'!message'
=>
$message
)));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment