MDL-66903 testing: Add support for a \tests\ namespace during tests

This commit:
- introduces a \tests\ sub-namespace for use in unit tests only
- the path to this the tests/classes directory of the owning parent
- files here are excluded from unit test runs

This is agreed per policy in MDL-80855.
This commit is contained in:
Andrew Nicols
2024-07-15 12:21:54 +08:00
parent b15b73848a
commit 6b3d8fd889
5 changed files with 231 additions and 60 deletions
+2
View File
@@ -529,6 +529,7 @@ class phpunit_util extends testing_util {
$template = <<<EOF
<testsuite name="@component@_testsuite">
<directory suffix="_test.php">@dir@</directory>
<exclude>@dir@/classes</exclude>
</testsuite>
EOF;
@@ -621,6 +622,7 @@ class phpunit_util extends testing_util {
<testsuites>
<testsuite name="@component@_testsuite">
<directory suffix="_test.php">.</directory>
<exclude>./classes</exclude>
</testsuite>
</testsuites>
EOT;