If I use Shippable for CI with PHPUnit, I do not know how to have several test-classes at a time.
If I put all my tests in 1 class, it works fine and I get the reports and the sequence coverage. But if I want to have 2 test-classes, I don´t get the right reports.
My structure:
- config
- ...
- tests
- SQLTest.php
- UserTest.php
My shippable.yml:
language: php
php:
- 5.4
before_script:
- mkdir -p shippable/testresults
- mkdir -p shippable/codecoverage
- mysql -e 'create database if not exists test;'
script:
- phpunit --log-junit shippable/testresults/junit.xml --coverage-xml shippable/codecoverage tests
SQLTest.php:
class SQLTest extends PHPUnit_Framework_TestCase {
public function testRandomStringLength(){
$test = "string";
$this -> assertEquals(strlen($test), 6);
}
}
UserTest.php:
class UserTest extends PHPUnit_Framework_TestCase {
public function testRandomStringLength(){
$test = "string";
$this -> assertEquals(strlen($test), 6);
}
}
The log on Shippable says:
Time: 202 ms, Memory: 7.75Mb
OK (2 tests, 2 assertions)
Generating code coverage report in PHPUnit XML format ... done
The build is successful. But when I click the Tests-tab it says No tests for this build.
. Why is that happening?