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 e6966b7ae7
commit 7b0946129c
5 changed files with 232 additions and 63 deletions
+2
View File
@@ -505,6 +505,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;
@@ -597,6 +598,7 @@ class phpunit_util extends testing_util {
<testsuites>
<testsuite name="@component@_testsuite">
<directory suffix="_test.php">.</directory>
<exclude>./classes</exclude>
</testsuite>
</testsuites>
EOT;