Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443488
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443488
Commits
fb9d4564
Commit
fb9d4564
authored
16 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#299461
by Damien Tournoud: fixed annoying glitches with assertEqual().
parent
6261c4ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/simpletest/drupal_web_test_case.php
+13
-13
13 additions, 13 deletions
modules/simpletest/drupal_web_test_case.php
with
13 additions
and
13 deletions
modules/simpletest/drupal_web_test_case.php
+
13
−
13
View file @
fb9d4564
...
...
@@ -105,7 +105,7 @@ protected function _assert($status, $message = '', $group = 'Other', $custom_cal
* The status passed in.
*/
protected
function
assertTrue
(
$value
,
$message
=
''
,
$group
=
'Other'
)
{
return
$this
->
_assert
((
bool
)
$value
,
$message
?
$message
:
t
(
'
%v
alue is TRUE'
,
array
(
'%value'
=>
$value
)
),
$group
);
return
$this
->
_assert
((
bool
)
$value
,
$message
?
$message
:
t
(
'
V
alue is TRUE'
),
$group
);
}
/**
...
...
@@ -121,7 +121,7 @@ protected function assertTrue($value, $message = '', $group = 'Other') {
* The status passed in.
*/
protected
function
assertFalse
(
$value
,
$message
=
''
,
$group
=
'Other'
)
{
return
$this
->
_assert
(
!
$value
,
$message
?
$message
:
t
(
'
%v
alue is FALSE'
,
array
(
'%value'
=>
$value
)
),
$group
);
return
$this
->
_assert
(
!
$value
,
$message
?
$message
:
t
(
'
V
alue is FALSE'
),
$group
);
}
/**
...
...
@@ -137,7 +137,7 @@ protected function assertFalse($value, $message = '', $group = 'Other') {
* The status passed in.
*/
protected
function
assertNull
(
$value
,
$message
=
''
,
$group
=
'Other'
)
{
return
$this
->
_assert
(
!
isset
(
$value
),
$message
?
$message
:
t
(
'
%v
alue is NULL'
,
array
(
'%value'
=>
$value
)
),
$group
);
return
$this
->
_assert
(
!
isset
(
$value
),
$message
?
$message
:
t
(
'
V
alue is NULL'
),
$group
);
}
/**
...
...
@@ -153,7 +153,7 @@ protected function assertNull($value, $message = '', $group = 'Other') {
* The status passed in.
*/
protected
function
assertNotNull
(
$value
,
$message
=
''
,
$group
=
'Other'
)
{
return
$this
->
_assert
(
isset
(
$value
),
$message
?
$message
:
t
(
'
%v
alue is not NULL'
,
array
(
'%value'
=>
$value
)
),
$group
);
return
$this
->
_assert
(
isset
(
$value
),
$message
?
$message
:
t
(
'
V
alue is not NULL'
),
$group
);
}
/**
...
...
@@ -171,7 +171,7 @@ protected function assertNotNull($value, $message = '', $group = 'Other') {
* The status passed in.
*/
protected
function
assertEqual
(
$first
,
$second
,
$message
=
''
,
$group
=
'Other'
)
{
return
$this
->
_assert
(
$first
==
$second
,
$message
?
$message
:
t
(
'
%f
irst is equal to
%
second
'
,
array
(
'%first'
=>
$first
,
'%second'
=>
$second
)
),
$group
);
return
$this
->
_assert
(
$first
==
$second
,
$message
?
$message
:
t
(
'
F
irst
value
is equal to second
value'
),
$group
);
}
/**
...
...
@@ -189,7 +189,7 @@ protected function assertEqual($first, $second, $message = '', $group = 'Other')
* The status passed in.
*/
protected
function
assertNotEqual
(
$first
,
$second
,
$message
=
''
,
$group
=
'Other'
)
{
return
$this
->
_assert
(
$first
!=
$second
,
$message
?
$message
:
t
(
'
%f
irst is not equal to
%
second
'
,
array
(
'%first'
=>
$first
,
'%second'
=>
$second
)
),
$group
);
return
$this
->
_assert
(
$first
!=
$second
,
$message
?
$message
:
t
(
'
F
irst
value
is not equal to second
value'
),
$group
);
}
/**
...
...
@@ -207,7 +207,7 @@ protected function assertNotEqual($first, $second, $message = '', $group = 'Othe
* The status passed in.
*/
protected
function
assertIdentical
(
$first
,
$second
,
$message
=
''
,
$group
=
'Other'
)
{
return
$this
->
_assert
(
$first
===
$second
,
$message
?
$message
:
t
(
'
%f
irst is identical to
%
second
'
,
array
(
'%first'
=>
$first
,
'%second'
=>
$second
)
),
$group
);
return
$this
->
_assert
(
$first
===
$second
,
$message
?
$message
:
t
(
'
F
irst
value
is identical to second
value'
),
$group
);
}
/**
...
...
@@ -225,7 +225,7 @@ protected function assertIdentical($first, $second, $message = '', $group = 'Oth
* The status passed in.
*/
protected
function
assertNotIdentical
(
$first
,
$second
,
$message
=
''
,
$group
=
'Other'
)
{
return
$this
->
_assert
(
$first
!==
$second
,
$message
?
$message
:
t
(
'
%f
irst is not identical to
%
second
'
,
array
(
'%first'
=>
$first
,
'%second'
=>
$second
)
),
$group
);
return
$this
->
_assert
(
$first
!==
$second
,
$message
?
$message
:
t
(
'
F
irst
value
is not identical to second
value'
),
$group
);
}
/**
...
...
@@ -1254,7 +1254,7 @@ function drupalSetContent($content, $url = 'internal:') {
* @return
* TRUE on pass, FALSE on fail.
*/
function
assertRaw
(
$raw
,
$message
=
"
%s
"
,
$group
=
'Other'
)
{
function
assertRaw
(
$raw
,
$message
=
'
%s
found'
,
$group
=
'Other'
)
{
return
$this
->
_assert
(
strpos
(
$this
->
_content
,
$raw
)
!==
FALSE
,
$message
,
$group
);
}
...
...
@@ -1271,7 +1271,7 @@ function assertRaw($raw, $message = "%s", $group = 'Other') {
* @return
* TRUE on pass, FALSE on fail.
*/
function
assertNoRaw
(
$raw
,
$message
=
"
%s
"
,
$group
=
'Other'
)
{
function
assertNoRaw
(
$raw
,
$message
=
'
%s
found'
,
$group
=
'Other'
)
{
return
$this
->
_assert
(
strpos
(
$this
->
_content
,
$raw
)
===
FALSE
,
$message
,
$group
);
}
...
...
@@ -1332,7 +1332,7 @@ protected function assertTextHelper($text, $message, $group, $not_exists) {
$this
->
plain_text
=
filter_xss
(
$this
->
_content
,
array
());
}
if
(
!
$message
)
{
$message
=
'"'
.
$text
.
'"'
.
(
$not_exists
?
' not found
.
'
:
' found
.
'
);
$message
=
'"'
.
$text
.
'"'
.
(
$not_exists
?
' not found'
:
' found'
);
}
return
$this
->
_assert
(
$not_exists
==
(
strpos
(
$this
->
plain_text
,
$text
)
===
FALSE
),
$message
,
$group
);
}
...
...
@@ -1349,7 +1349,7 @@ protected function assertTextHelper($text, $message, $group, $not_exists) {
* @return
* TRUE on pass, FALSE on fail.
*/
function
assertPattern
(
$pattern
,
$message
=
'
%s
'
,
$group
=
'Other'
)
{
function
assertPattern
(
$pattern
,
$message
=
'
Pattern %s found
'
,
$group
=
'Other'
)
{
return
$this
->
_assert
((
bool
)
preg_match
(
$pattern
,
$this
->
drupalGetContent
()),
$message
,
$group
);
}
...
...
@@ -1365,7 +1365,7 @@ function assertPattern($pattern, $message = '%s', $group = 'Other') {
* @return
* TRUE on pass, FALSE on fail.
*/
function
assertNoPattern
(
$pattern
,
$message
=
'
%s
'
,
$group
=
'Other'
)
{
function
assertNoPattern
(
$pattern
,
$message
=
'
Pattern %s not found
'
,
$group
=
'Other'
)
{
return
$this
->
_assert
(
!
preg_match
(
$pattern
,
$this
->
drupalGetContent
()),
$message
,
$group
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment