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
063fe482
Commit
063fe482
authored
14 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#742972
follow-up by klausi, sun: Fix documentation and tests regarding entity cache clearing.
parent
6c2b8b7d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/simpletest/tests/entity_cache_test.module
+13
-7
13 additions, 7 deletions
modules/simpletest/tests/entity_cache_test.module
modules/system/system.test
+4
-1
4 additions, 1 deletion
modules/system/system.test
with
17 additions
and
8 deletions
modules/simpletest/tests/entity_cache_test.module
+
13
−
7
View file @
063fe482
...
@@ -9,14 +9,20 @@
...
@@ -9,14 +9,20 @@
/**
/**
* Implements hook_watchdog().
* Implements hook_watchdog().
*
*
* This function is called during module_enable() and tries to access entity
* This hook is called during module_enable() and since this hook
* information provided by the module this one depends on. The information is
* implementation is invoked, we have to expect that this module and dependent
* stored in a temporary system variable and is later analyzed in the test
* modules have been properly installed already. So we expect to be able to
* case.
* retrieve the entity information that has been registered by the required
* dependency module.
*
*
* @see EnableDisableTestCase::testEntityCache()
* @see EnableDisableTestCase::testEntityCache()
* @see entity_cache_test_dependency_entity_info()
*/
*/
function
entity_cache_test_watchdog
()
{
function
entity_cache_test_watchdog
(
$log_entry
)
{
$info
=
entity_get_info
(
'entity_cache_test'
);
if
(
$log_entry
[
'type'
]
==
'system'
&&
$log_entry
[
'message'
]
==
'%module module installed.'
)
{
variable_set
(
'entity_cache_test'
,
$info
);
$info
=
entity_get_info
(
'entity_cache_test'
);
// Store the information in a system variable to analyze it later in the
// test case.
variable_set
(
'entity_cache_test'
,
$info
);
}
}
}
This diff is collapsed.
Click to expand it.
modules/system/system.test
+
4
−
1
View file @
063fe482
...
@@ -161,11 +161,14 @@ class EnableDisableTestCase extends ModuleTestCase {
...
@@ -161,11 +161,14 @@ class EnableDisableTestCase extends ModuleTestCase {
/**
/**
* Tests entity cache after enabling a module with a dependency on an enitity
* Tests entity cache after enabling a module with a dependency on an enitity
* providing module.
* providing module.
*
* @see entity_cache_test_watchdog()
*/
*/
function
testEntityCache
()
{
function
testEntityCache
()
{
module_enable
(
array
(
'entity_cache_test'
));
module_enable
(
array
(
'entity_cache_test'
));
$info
=
variable_get
(
'entity_cache_test'
);
$info
=
variable_get
(
'entity_cache_test'
);
$this
->
assertNotNull
(
$info
,
t
(
'Entity information must not be NULL'
));
$this
->
assertEqual
(
$info
[
'label'
],
'Entity Cache Test'
,
'Entity info label is correct.'
);
$this
->
assertEqual
(
$info
[
'controller class'
],
'DrupalDefaultEntityController'
,
'Entity controller class info is correct.'
);
}
}
}
}
...
...
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