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
15ccf7fc
Commit
15ccf7fc
authored
Oct 23, 2015
by
alexpott
Browse files
Issue
#2597644
by Mile23: ComposerIntegrationTest::testAllModulesReplaced() doesn't test anything
parent
dcdb03e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/composer.json
View file @
15ccf7fc
...
...
@@ -89,6 +89,7 @@
"drupal/help"
:
"self.version"
,
"drupal/history"
:
"self.version"
,
"drupal/image"
:
"self.version"
,
"drupal/inline_form_errors"
:
"self.version"
,
"drupal/language"
:
"self.version"
,
"drupal/link"
:
"self.version"
,
"drupal/locale"
:
"self.version"
,
...
...
core/tests/Drupal/Tests/ComposerIntegrationTest.php
View file @
15ccf7fc
...
...
@@ -75,20 +75,33 @@ public function testComposerJson() {
* core's composer.json.
*/
public
function
testAllModulesReplaced
()
{
// Assemble a path to core modules.
$module_path
=
$this
->
root
.
'/core/modules'
;
// Grab the 'replace' section of the core composer.json file.
$json
=
json_decode
(
file_get_contents
(
$this
->
root
.
'/core/composer.json'
));
$composer_replace_packages
=
$json
->
replace
;
$composer_replace_packages
=
(
array
)
$json
->
replace
;
$folders
=
scandir
(
$this
->
root
.
'/core/modules'
);
// Get a list of all the files in the module path.
$folders
=
scandir
(
$module_path
);
// Make sure we only deal with directories that aren't . or ..
$module_names
=
[];
$discard
=
[
'.'
,
'..'
];
foreach
(
$folders
as
$file_name
)
{
if
(
$file_name
!==
'.'
&&
$file_name
!==
'..'
&&
is_dir
(
$file_name
))
{
if
(
(
!
in_array
(
$file_name
,
$discard
))
&&
is_dir
(
$module_path
.
'/'
.
$file_name
))
{
$module_names
[]
=
$file_name
;
}
}
// Assert that each core module has a corresponding 'replace' in
// composer.json.
foreach
(
$module_names
as
$module_name
)
{
$this
->
assertTrue
(
array_key_exists
(
'drupal/'
.
$module_name
,
$composer_replace_packages
),
'Found '
.
$module_name
.
' in replace list of composer.json'
);
$this
->
assertArrayHasKey
(
'drupal/'
.
$module_name
,
$composer_replace_packages
,
'Unable to find '
.
$module_name
.
' in replace list of composer.json'
);
}
}
...
...
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