Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
apc
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
project
apc
Commits
713a27bb
Verified
Commit
713a27bb
authored
6 months ago
by
Alberto Paderno
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3464314
: Do not use t() for the assert messages
parent
61c6f5d5
No related branches found
No related tags found
1 merge request
!47
Issue #3464314: Do not use t() for the assert messages
Pipeline
#236576
passed
6 months ago
Stage: build
Stage: validate
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/apc.test
+16
-16
16 additions, 16 deletions
tests/apc.test
with
16 additions
and
16 deletions
tests/apc.test
+
16
−
16
View file @
713a27bb
...
...
@@ -58,7 +58,7 @@ class ApcCacheTestCase extends DrupalWebTestCase {
$obj
=
_cache_get_object
(
$bin
);
if
(
!
(
$obj
instanceof
DrupalAPCCache
))
{
$error
=
t
(
'The cache class %class for %bin is not DrupalAPCCache.'
,
$error
=
format_string
(
'The cache class %class for %bin is not DrupalAPCCache.'
,
array
(
'%bin'
=>
$bin
,
'%class'
=>
get_class
(
$obj
),
...
...
@@ -72,7 +72,7 @@ class ApcCacheTestCase extends DrupalWebTestCase {
}
}
else
{
$error
=
t
(
'The APCu extension is not loaded or APCu is not enabled for the current environment.'
)
;
$error
=
'The APCu extension is not loaded or APCu is not enabled for the current environment.'
;
$this
->
fail
(
$error
);
$this
->
setup
=
FALSE
;
...
...
@@ -90,7 +90,7 @@ class ApcCacheTestCase extends DrupalWebTestCase {
* The value the cache should contain, or NULL if the value is not relevant.
*/
protected
function
assertCacheItem
(
$bin
,
$cid
,
$value
=
NULL
)
{
$message
=
t
(
$message
=
format_string
(
'@cache_id was correctly stored in the cache.'
,
array
(
'@cache_id'
=>
$cid
)
);
...
...
@@ -98,7 +98,7 @@ class ApcCacheTestCase extends DrupalWebTestCase {
$item
=
cache_get
(
$cid
,
$bin
);
$this
->
assertTrue
(
isset
(
$item
->
data
),
t
(
'@cache_id was found in the cache.'
,
array
(
'@cache_id'
=>
$cid
))
format_string
(
'@cache_id was found in the cache.'
,
array
(
'@cache_id'
=>
$cid
))
);
if
(
!
is_null
(
$value
))
{
...
...
@@ -115,7 +115,7 @@ class ApcCacheTestCase extends DrupalWebTestCase {
* The cache ID.
*/
protected
function
assertNoCacheItem
(
$bin
,
$cid
)
{
$message
=
t
(
$message
=
format_string
(
'@cache_id was not found in the cache.'
,
array
(
'@cache_id'
=>
$cid
)
);
...
...
@@ -140,18 +140,18 @@ class ApcCacheTestCase extends DrupalWebTestCase {
foreach
(
$values
as
$cid
=>
$value
)
{
$this
->
assertTrue
(
isset
(
$items
[
$cid
]),
t
(
'@cache_id was found in the cache.'
,
array
(
'@cache_id'
=>
$cid
))
format_string
(
'@cache_id was found in the cache.'
,
array
(
'@cache_id'
=>
$cid
))
);
$this
->
assertTrue
(
is_object
(
$items
[
$cid
])
&&
isset
(
$items
[
$cid
]
->
data
),
t
(
'@cache_id was correctly stored in the cache.'
,
array
(
'@cache_id'
=>
$cid
)));
format_string
(
'@cache_id was correctly stored in the cache.'
,
array
(
'@cache_id'
=>
$cid
)));
if
(
!
is_null
(
$value
)
&&
is_object
(
$items
[
$cid
])
&&
isset
(
$items
[
$cid
]
->
data
))
{
$this
->
assertIdentical
(
$items
[
$cid
]
->
data
,
$value
,
t
(
'@cache_id was correctly stored in the cache.'
,
array
(
'@cache_id'
=>
$cid
))
format_string
(
'@cache_id was correctly stored in the cache.'
,
array
(
'@cache_id'
=>
$cid
))
);
}
}
...
...
@@ -173,7 +173,7 @@ class ApcCacheTestCase extends DrupalWebTestCase {
foreach
(
$non_existent_cids
as
$cid
)
{
$this
->
assertFalse
(
isset
(
$items
[
$cid
]),
t
(
'@cache_id was not found in the cache.'
,
array
(
'@cache_id'
=>
$cid
))
format_string
(
'@cache_id was not found in the cache.'
,
array
(
'@cache_id'
=>
$cid
))
);
}
}
...
...
@@ -236,18 +236,18 @@ class ApcCacheSaveAndRetrieveCase extends ApcCacheTestCase {
*/
public
function
testRetrieveMultipleValue
()
{
$bin
=
'cache_apc'
;
$
cid
s
=
array
(
$
value
s
=
array
(
$this
->
randomName
(
16
)
=>
$this
->
randomString
(
16
),
$this
->
randomName
(
16
)
=>
$this
->
randomString
(
32
),
);
$cids
=
array_keys
(
$values
);
foreach
(
$
cid
s
as
$cid
=>
$value
)
{
foreach
(
$
value
s
as
$cid
=>
$value
)
{
cache_set
(
$cid
,
$value
,
$bin
);
}
$this
->
assertCacheItems
(
$bin
,
$cids
);
$this
->
assertCacheItems
(
$bin
,
$cids
,
$values
);
$cids
=
array_keys
(
$cids
);
cache_clear_all
(
$cids
[
1
],
$bin
);
$this
->
assertNoCacheItems
(
$bin
,
$cids
,
array
(
$cids
[
1
],
'item3'
));
}
...
...
@@ -399,16 +399,16 @@ class ApcCacheIsEmptyCase extends ApcCacheTestCase {
cache_set
(
'test_temporary'
,
$this
->
randomString
(),
$bin
);
cache_clear_all
(
'*'
,
$bin
,
TRUE
);
$this
->
assertTrue
(
cache_is_empty
(
$bin
),
t
(
'The cache bin is empty.'
)
)
;
$this
->
assertTrue
(
cache_is_empty
(
$bin
),
'The cache bin is empty.'
);
$value
=
$this
->
randomString
(
16
);
cache_set
(
'test_temporary'
,
$value
,
$bin
);
$this
->
assertCacheItem
(
$bin
,
'test_temporary'
,
$value
);
$this
->
assertFalse
(
cache_is_empty
(
$bin
),
t
(
'The cache bin is not empty.'
)
)
;
$this
->
assertFalse
(
cache_is_empty
(
$bin
),
'The cache bin is not empty.'
);
cache_clear_all
(
'test_temporary'
,
$bin
);
$this
->
assertNoCacheItem
(
$bin
,
'test_temporary'
);
$this
->
assertTrue
(
cache_is_empty
(
$bin
),
t
(
'The cache bin is empty.'
)
)
;
$this
->
assertTrue
(
cache_is_empty
(
$bin
),
'The cache bin is empty.'
);
}
}
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