Add testsuite coverage to phpunit
authorAndrew Nicols <andrew@nicols.co.uk>
Wed, 12 Nov 2014 03:25:27 +0000 (11:25 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 12 Nov 2014 03:53:58 +0000 (11:53 +0800)
commit059abb287d9b2375c84df3036b9ae7c0302835ff
tree1fa57590f88936d4b44cb724c78795b73e358147
parentab6a722c52de13f35e8fec6b677ceec6aa1606f9
Add testsuite coverage to phpunit

In Moodle, we put all of our test directories into testsuites. For example, the
message/tests directory is defined in the core_message_testsuite testsuite.

Because of our naming scheme for files, we cannot simply pass the directory as
this only looks for files with the suffix Test.php. We can however make use
of the testsuite option to phpunit.

Suites are named as per their frankenstyle component and the complete list
can be found in the generated phpunit.xml configration. Here's an excerpt
for the above example:

    <testsuite name="core_message_testsuite">
        <directory suffix="_test.php">message/tests</directory>
    </testsuite>

With this change, it becomes possible to run all tests for an entire
component quickly and easily:

    mdk phpunit -s core_message_testsuite
extra/bash_completion
mdk/commands/phpunit.py
mdk/phpunit.py