Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
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
drupal
Commits
ef6a11d8
Unverified
Commit
ef6a11d8
authored
6 years ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3054315
by yogeshmpawar, alexpott: Sort out ApcuBackendTest
parent
08879cc0
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php
+1
-152
1 addition, 152 deletions
core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php
with
1 addition
and
152 deletions
core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php
+
1
−
152
View file @
ef6a11d8
...
...
@@ -13,48 +13,6 @@
*/
class
ApcuBackendTest
extends
GenericCacheBackendUnitTestBase
{
/**
* Get a list of failed requirements.
*
* This specifically bypasses checkRequirements because it fails tests. PHP 7
* does not have APCu and simpletest does not have a explicit "skip"
* functionality so to emulate it we override all test methods and explicitly
* pass when requirements are not met.
*
* @return array
*/
protected
function
getRequirements
()
{
$requirements
=
[];
if
(
!
extension_loaded
(
'apcu'
))
{
$requirements
[]
=
'APCu extension not found.'
;
}
else
{
if
(
PHP_SAPI
===
'cli'
&&
!
ini_get
(
'apc.enable_cli'
))
{
$requirements
[]
=
'apc.enable_cli must be enabled to run this test.'
;
}
}
return
$requirements
;
}
/**
* Check if requirements fail.
*
* If the requirements fail the test method should return immediately instead
* of running any tests. Messages will be output to display why the test was
* skipped.
*/
protected
function
requirementsFail
()
{
$requirements
=
$this
->
getRequirements
();
if
(
!
empty
(
$requirements
))
{
foreach
(
$requirements
as
$message
)
{
$this
->
pass
(
$message
);
}
return
TRUE
;
}
return
FALSE
;
}
/**
* {@inheritdoc}
*/
...
...
@@ -81,22 +39,13 @@ protected function tearDown() {
* {@inheritdoc}
*/
public
function
testSetGet
()
{
if
(
$this
->
requirementsFail
())
{
return
;
}
parent
::
testSetGet
();
// Make sure entries are permanent (i.e. no TTL).
$backend
=
$this
->
getCacheBackend
(
$this
->
getTestBin
());
$key
=
$backend
->
getApcuKey
(
'TEST8'
);
if
(
class_exists
(
'\APCUIterator'
))
{
$iterator
=
new
\APCUIterator
(
'/^'
.
$key
.
'/'
);
}
else
{
$iterator
=
new
\APCIterator
(
'user'
,
'/^'
.
$key
.
'/'
);
}
$iterator
=
new
\APCUIterator
(
'/^'
.
$key
.
'/'
);
foreach
(
$iterator
as
$item
)
{
$this
->
assertEqual
(
0
,
$item
[
'ttl'
]);
$found
=
TRUE
;
...
...
@@ -104,104 +53,4 @@ public function testSetGet() {
$this
->
assertTrue
(
$found
);
}
/**
* {@inheritdoc}
*/
public
function
testDelete
()
{
if
(
$this
->
requirementsFail
())
{
return
;
}
parent
::
testDelete
();
}
/**
* {@inheritdoc}
*/
public
function
testValueTypeIsKept
()
{
if
(
$this
->
requirementsFail
())
{
return
;
}
parent
::
testValueTypeIsKept
();
}
/**
* {@inheritdoc}
*/
public
function
testGetMultiple
()
{
if
(
$this
->
requirementsFail
())
{
return
;
}
parent
::
testGetMultiple
();
}
/**
* {@inheritdoc}
*/
public
function
testSetMultiple
()
{
if
(
$this
->
requirementsFail
())
{
return
;
}
parent
::
testSetMultiple
();
}
/**
* {@inheritdoc}
*/
public
function
testDeleteMultiple
()
{
if
(
$this
->
requirementsFail
())
{
return
;
}
parent
::
testDeleteMultiple
();
}
/**
* {@inheritdoc}
*/
public
function
testDeleteAll
()
{
if
(
$this
->
requirementsFail
())
{
return
;
}
parent
::
testDeleteAll
();
}
/**
* {@inheritdoc}
*/
public
function
testInvalidate
()
{
if
(
$this
->
requirementsFail
())
{
return
;
}
parent
::
testInvalidate
();
}
/**
* {@inheritdoc}
*/
public
function
testInvalidateTags
()
{
if
(
$this
->
requirementsFail
())
{
return
;
}
parent
::
testInvalidateTags
();
}
/**
* {@inheritdoc}
*/
public
function
testInvalidateAll
()
{
if
(
$this
->
requirementsFail
())
{
return
;
}
parent
::
testInvalidateAll
();
}
/**
* {@inheritdoc}
*/
public
function
testRemoveBin
()
{
if
(
$this
->
requirementsFail
())
{
return
;
}
parent
::
testRemoveBin
();
}
}
This diff is collapsed.
Click to expand it.
Alex Pott
@alexpott
mentioned in commit
e91c5eca
·
6 years ago
mentioned in commit
e91c5eca
mentioned in commit e91c5eca7632dccc9f94e9916bbee8db610e774b
Toggle commit list
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