Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
ce051755
Commit
ce051755
authored
Dec 01, 2012
by
webchick
Browse files
Issue
#1843452
by ACF: Change dependency_test() variable to state system.
parent
7a9c8d86
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php
View file @
ce051755
...
...
@@ -132,7 +132,7 @@ function testModuleEnableOrder() {
module_enable
(
array
(
'module_test'
),
FALSE
);
$this
->
resetAll
();
$this
->
assertModules
(
array
(
'module_test'
),
TRUE
);
variable_set
(
'
dependency
_test
'
,
'dependency'
);
state
()
->
set
(
'module_test.
dependency'
,
'dependency'
);
// module_test creates a dependency chain:
// - forum depends on taxonomy, comment, history, and poll (via module_test)
// - taxonomy depends on options
...
...
core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
View file @
ce051755
...
...
@@ -159,7 +159,7 @@ function testDependencyResolution() {
// First, create a fake missing dependency. Forum depends on poll, which
// depends on a made-up module, foo. Nothing should be installed.
variable_set
(
'
dependency
_test
'
,
'missing dependency'
);
state
()
->
set
(
'module_test.
dependency'
,
'missing dependency'
);
drupal_static_reset
(
'system_rebuild_module_data'
);
$result
=
module_enable
(
array
(
'forum'
));
$this
->
assertFalse
(
$result
,
'module_enable() returns FALSE if dependencies are missing.'
);
...
...
@@ -167,7 +167,7 @@ function testDependencyResolution() {
// Now, fix the missing dependency. Forum module depends on poll, but poll
// depends on the PHP module. module_enable() should work.
variable_set
(
'
dependency
_test
'
,
'dependency'
);
state
()
->
set
(
'module_test.
dependency'
,
'dependency'
);
drupal_static_reset
(
'system_rebuild_module_data'
);
$result
=
module_enable
(
array
(
'forum'
));
$this
->
assertTrue
(
$result
,
'module_enable() returns the correct value.'
);
...
...
@@ -230,7 +230,7 @@ function testDependencyResolution() {
// php module. But, this time do it with poll module declaring a dependency
// on a specific version of php module in its info file. Make sure that
// module_enable() still works.
variable_set
(
'
dependency
_test
'
,
'version dependency'
);
state
()
->
set
(
'module_test.
dependency'
,
'version dependency'
);
drupal_static_reset
(
'system_rebuild_module_data'
);
$result
=
module_enable
(
array
(
'forum'
));
$this
->
assertTrue
(
$result
,
'module_enable() returns the correct value.'
);
...
...
core/modules/system/tests/modules/module_test/module_test.module
View file @
ce051755
...
...
@@ -15,7 +15,7 @@ function module_test_permission() {
* Manipulate module dependencies to test dependency chains.
*/
function
module_test_system_info_alter
(
&
$info
,
$file
,
$type
)
{
if
(
variable_get
(
'dependency_test'
,
FALSE
)
==
'missing dependency'
)
{
if
(
state
()
->
get
(
'module_test.dependency'
)
==
'missing dependency'
)
{
if
(
$file
->
name
==
'forum'
)
{
// Make forum module depend on poll.
$info
[
'dependencies'
][]
=
'poll'
;
...
...
@@ -25,7 +25,7 @@ function module_test_system_info_alter(&$info, $file, $type) {
$info
[
'dependencies'
][]
=
'foo'
;
}
}
elseif
(
variable_get
(
'dependency_test'
,
FALSE
)
==
'dependency'
)
{
elseif
(
state
()
->
get
(
'module_test.dependency'
)
==
'dependency'
)
{
if
(
$file
->
name
==
'forum'
)
{
// Make the forum module depend on poll.
$info
[
'dependencies'
][]
=
'poll'
;
...
...
@@ -35,7 +35,7 @@ function module_test_system_info_alter(&$info, $file, $type) {
$info
[
'dependencies'
][]
=
'php'
;
}
}
elseif
(
variable_get
(
'dependency_test'
,
FALSE
)
==
'version dependency'
)
{
elseif
(
state
()
->
get
(
'module_test.dependency'
)
==
'version dependency'
)
{
if
(
$file
->
name
==
'forum'
)
{
// Make the forum module depend on poll.
$info
[
'dependencies'
][]
=
'poll'
;
...
...
Write
Preview
Supports
Markdown
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