Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
303
Merge Requests
303
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
ce051755
Commit
ce051755
authored
Dec 01, 2012
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1843452
by ACF: Change dependency_test() variable to state system.
parent
7a9c8d86
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php
.../system/lib/Drupal/system/Tests/Module/DependencyTest.php
+1
-1
core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
...s/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
+3
-3
core/modules/system/tests/modules/module_test/module_test.module
...dules/system/tests/modules/module_test/module_test.module
+3
-3
No files found.
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
Markdown
is supported
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