I have defined the list of the Test files which needs to be executed in a order in phpunit.xml.
As per http://phpunit.de/manual/3.7/en/organizing-tests.html#organizing-tests.xml-configuration it is mentioned that order of the test case can be defined as:
<phpunit>
<testsuites>
<testsuite name="Object_Freezer">
<file>Tests/Freezer/HashGenerator/NonRecursiveSHA1Test.php</file>
<file>Tests/Freezer/IdGenerator/UUIDTest.php</file>
<file>Tests/Freezer/UtilTest.php</file>
<file>Tests/FreezerTest.php</file>
<file>Tests/Freezer/StorageTest.php</file>
<file>Tests/Freezer/Storage/CouchDB/WithLazyLoadTest.php</file>
<file>Tests/Freezer/Storage/CouchDB/WithoutLazyLoadTest.php</file>
</testsuite>
</testsuites>
</phpunit>
But as it seems like PHPUnit is ignoring the config in phpunit.xml and executing the test cases in alphabetical order.
I want to define order just because I want one of my test case to be executed at the end. Below is my code:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="true"
stopOnFailure="false"
forceCoversAnnotation="true"
bootstrap="../application/third_party/CIUnit/bootstrap_phpunit.php">
<testsuites>
<testsuite name="ModelTests">
<directory suffix=".php">models</directory>
<file>./models/aa.php</file>
<file>./models/bb.php</file>
<file>./models/cc.php</file>
<file>./models/dd.php</file>
<file>./models/ab.php</file>
<file>./models/ac.php</file>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">models</directory>
</whitelist>
</filter>
</phpunit>
when I execute phpunit it prints: Configuration read from /var/www/builds/latest/tests/phpunit.xml
Any idea?