<phpunit> <formatter todir="reports" type="xml"/> <batchtest> <fileset dir="tests"> <include name="**/*Test*.php"/> <exclude name="**/Abstract*.php"/> </fileset> </batchtest> </phpunit>
Runs all matching testcases in the directory tests
, writing
XML results to the directory reports
.
<phpunit codecoverage="true" haltonfailure="true" haltonerror="true"> <formatter type="plain" usefile="false"/> <batchtest> <fileset dir="tests"> <include name="**/*Test*.php"/> </fileset> </batchtest> </phpunit>
Runs all matching testcases in the directory tests
, gathers
code coverage information, writing plain text results to the console. The build
process is aborted if a test fails.
<phpunit bootstrap="src/autoload.php"> <formatter type="plain" usefile="false"/> <batchtest> <fileset dir="tests"> <include name="**/*Test*.php"/> </fileset> </batchtest> </phpunit>
Runs all matching testcases in the directory tests
, writing
plain text results to the console. Additionally, before executing the tests, the
bootstrap file src/autoload.php
is loaded.
Important note: using a mechanism such as an "AllTests.php" file to execute testcases will bypass the Phing hooks used for reporting and counting, and could possibly lead to strange results. Instead, use one of more fileset's to provide a list of testcases to execute.