In a directory I have two files
oneTest.php
<?php
class oneTest extends PHPUnit_Framework_TestCase {
public function testSomethingOne()
{
echo 'ONE TEST';
$this->assertEquals(1, 1);
}
}
twoTest.php
<?php
class twoTest extends PHPUnit_Framework_TestCase {
public function testSomethingTwo()
{
echo 'TWO TEST';
$this->assertEquals(2, 2);
}
}
From within the directory I can run both tests fine
phpunit oneTest.php
phpunit twoTest.php
And I get the expected output on both.
If I try and run all tests with
phpunit *
It only runs the first test.
I’m running phpunit 3.6.12 on Ubuntu 12.04.
Any ideas why this is happening?
Thanks
This is simply a limitation of phpunit, it is not programmed to support multiple files on the command line. You can, however, pass a directory name to phpunit. If you want to run the tests in the current directory, use
Edit: alternatively, you can specify a testsuite in a XML configuration file.