You need to write some unit tests and set the script
variable in your .travis.yml
to actually run a file.
By default, Travis CI runs the command phpunit
without any arguments. When this happens, phpunit
doesn't know what you're asking it to do, and shows a help message, then exits with error code 2 (i.e. non-zero, which indicates an error occurred).
The Beginner's Guide shows you a possible solution of setting the script
variable to run a Test.php
file with your tests in (insert this into your .travis.yml
):
script: phpunit Test.php
There is an example of a valid Test.php
in the example repo that Travis provides:
<?php
class Test extends PHPUnit_Framework_TestCase
{
public function testOnePlusOne() {
$this->assertEquals(1+1,1);
}
}
?>