Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
<testsuites>
<testsuite name="Drupal Unit Test Suite">
<directory>./tests</directory>
<directory>./modules/*/tests</directory>
<directory>../modules</directory>
<directory>../sites/*/modules</directory>
<!-- Exclude Composer's vendor directory so we don't run tests there. -->
<exclude>./vendor</exclude>
<!-- Exclude Drush tests. -->
<exclude>./drush/tests</exclude>
<!-- Exclude special-case files from config's test modules. -->
<exclude>./modules/config/tests/config_test/src</exclude>
</testsuite>
</testsuites>
Themes and profiles are not allowed! phpunit.xml.dist
We should add them and them to the whitelist too (cf #2287385: Fix PHPUnit coverage tests)
Comment | File | Size | Author |
---|---|---|---|
#1 | 2287925.1.patch | 1.15 KB | alexpott |
Comments
Comment #1
alexpottInteresting themes are not in container namespaces so can't have plugins - providing blocks would be something I think they should be able to do. Profiles are in container namespaces.
Comment #2
sunThere's no agreement on that yet. The original idea for D8 was that themes should be pure templating engines and should not contain functional PHP code beyond that. In any case, that discussion belongs into the related issue.
Comment #3
jhedstromAdding a related issue with some relevant discussion.
It seems to me that, regardless of the 'themes can contain OO/plugins' discussion, that they should be able to register PHPUnit, since procedural functions can still be unit tested.
Comment #4
jhedstromComment #5
mgiffordNeeds re-roll.
Comment #6
alexpott@jhedstrom how can the procedural functions be unit tested when the code is not autoloaded?
Comment #7
dawehnerEspecially with #474684: Allow themes to declare dependencies on modules we also basically said: complex code for themes should live in modules.
Comment #13
borisson_At least the themes part of this was fixed in #2769599: [PP-1] Allow themes to be testable. Profiles are also testable, standard, umami and minimal have tests.
Closing this issue as outdated.