Problem/Motivation
There are several issues producing false positives in FeaturesManagerTest::testAssignInterPackageDependenciesWithoutBundle()
and FeaturesManagerTest::testAssignInterPackageDependenciesWithBundle()
.
The main issues are:
-
$expected = $packages;
$expected
is a shallow copy of the array of packages, so we're in practice testing packages against themselves. -
Several calls in
FeaturesManagerTest::testAssignInterPackageDependenciesWithBundle()
don't use forms appropriate for a bundle. Examples:$bundle->getFullName('package')->willReturn('package');
Return value should be
'giraffe_package'
.$bundle->isDefault()->willReturn(TRUE);
Return value should be
FALSE
.$expected['package']->setDependencies(['my_other_feature', 'package2']);
'package2'
should be'giraffe_package2'
.
When fixed, the tests reveal two bugs:
- We're calling
FeaturesBundleInterface::getFullName()
on an already prefixed package machine name. - We're mistakenly making the setting of an existing module dependency based on a config dependency contingent on there being a package assigned.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#7 | interdiff.txt | 3.08 KB | nedjo |
#7 | 2657274-7.patch | 5.58 KB | nedjo |
|
Comments
Comment #2
nedjoInitial patch is limited to cloning the array of features bundles. This fails, suggesting problems either in our code or in our existing tests.
Comment #3
nedjoComment #5
nedjoFurther fixing up of tests. Also, fix an error recently introduced to
FeaturesManager::assignInterPackageDependencies()
, whereFeaturesBundleInterface::getFullName()
is called on an already-prefixed package machine name.Test is still failing:
An existing feature providing configuration required by an item should be added as a feature dependency, but apparently is not being added.
Comment #7
nedjoFix the remaining bug. Issue was that we were setting the providing feature only within a test for an assigned package. Instead, we need to do so also in the case where a package has not been assigned.
Comment #8
nedjoChanging to a bug and escalating to major, since the bugs are not only in the tests and will prevent correct setting of feature dependencies.
Comment #9
nedjoComment #11
nedjo