Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner created an issue. See original summary.

dawehner’s picture

Status: Active » Needs review
FileSize
1006 bytes

Here is a quick patch.

dawehner’s picture

FileSize
3.05 KB

Here is also a test

nedjo’s picture

Status: Needs review » Needs work

Thanks for the patch. And with a draft test too :)

+++ b/src/FeaturesManager.php
@@ -633,7 +633,7 @@ class FeaturesManager implements FeaturesManagerInterface {
+                $this->mergeUniqueItems($package['dependencies'], [$this->getAssigner()->getBundle()->getFullName($config_collection[$dependency_name]['name'])]);

'machine_name' is indeed incorrect. The dependency is on an existing exported feature, so the key we need here is 'package' (which tracks the package that provides the given piece of configuration) rather than 'name' (the name of the configuration item). For a bit more on what the config collection item keys represent, see the documentation to FeaturesManagerInterface::getConfigCollection().

I know the code is very hard to follow. We're trying to improve that in #2606926: Error "The following module is missing from the file system", #2595263: Remodel packages as objects, #2595265: Remodel configuration items in FeaturesManager::configCollection as objects, and #2569149: Use ConfigEntity for features bundles. Meanwhile, welcome to Features 3.x and thanks for helping fix things up!

nedjo’s picture

Status: Needs work » Needs review
FileSize
2.26 KB

Because I had to rewrite the section of code with this bug, I ended up including a fix in #2606926: Error "The following module is missing from the file system" (see patch).

I'd love get the test in though, particularly because it helps model how we can write similar tests. Here's a redraft.

Status: Needs review » Needs work

The last submitted patch, 5: features-dependencies-2608994-5.patch, failed testing.

nedjo’s picture

FileSize
2.93 KB

This is slightly closer but not yet completing for me locally.

nedjo’s picture

Status: Needs work » Needs review
FileSize
3.94 KB

This should pass, but only because I've removed an argument to FeaturesAssigner::getBundle(), suggesting a bug there.

nedjo’s picture

Title: Undefined index 'machine_name' in FeaturesManager::assignInterPackageDependencies() » Tests for FeaturesManager::assignInterPackageDependencies()
Parent issue: » #2383435: META: Features 3.x test coverage
dawehner’s picture

Here is one more detailed test, once with a once without a bundle.

Status: Needs review » Needs work

The last submitted patch, 10: 2608994-10.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
4.82 KB
755 bytes

Ha, you should not simply manipulate files before creating a patch.

  • nedjo committed 03d0669 on 8.x-3.x authored by dawehner
    Issue #2608994 by dawehner, nedjo: Tests for FeaturesManager::...
nedjo’s picture

Status: Needs review » Fixed

@dawehner: committed. This helps model what we need to do in other unit tests. Thanks for the guidance!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.