I am trying to run a unit test for one of my contributed modules in my local development environment. But it keeps throwing an error:

$:/path/to/web$ sudo -u www-data -E phpunit -c core/phpunit.xml profiles/abc/modules/contrib/entity_clone/tests/src/Functional/EntityCloneContentTest.php
PHPUnit 6.5.9 by Sebastian Bergmann and contributors.

Testing Drupal\Tests\entity_clone\Functional\EntityCloneContentTest
F                                                                   1 / 1 (100%)

Time: 8.49 seconds, Memory: 4.00MB

There was 1 failure:

1) Drupal\Tests\entity_clone\Functional\EntityCloneContentTest::testContentEntityClone
Unable to install modules entity_clone, block, node, datetime due to missing modules entity_clone.


Tests: 1, Assertions: 1, Failures: 1.

Any idea what is wrong here? I have tried with a few other modules also, same error. Do I have to do anything additional to add my profiles in the phpunit.xml?


1 Answer 1


We ran into the same issue with the 'cookies_etracker' submodule of 'etracker'.

I guess this happens, if you have a submodule AND a composer.json in your main module (not auto-generated by Drupal). Then I guess the dependencies for the tests are not auto-generated, while Drupal.org does it if no composer.json is present in the repo.

Someone had a similar problem described here: https://www.drupal.org/forum/support/module-development-and-code-questions/2018-06-21/sub-module-dependencies and here https://github.com/acquia/coding-standards-php/issues/6

I think it's a bug / conflict in the Drupal.org Testbot: https://www.drupal.org/project/drupalci_testbot/issues/3250126

Currently the only way to solve this is to remove the composer.json from the parent module entirely (which might not be wanted in most cases).

  • Appreciate your help. Will test it in a few days. Commented Nov 20, 2021 at 4:43
  • @PratipGhosh have you been successful? Would be nice for others here to know, if it helped or how you fixed it. Commented Feb 8, 2022 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.