#Test PHP projects using Travis-ci
##Required Files
- .travis.yml (in the root folder of your project)
language: php
php:
- 5.2
- 5.3
before_script:
- ./tests/before_script.sh #this script is run before the tests and performs all tasks needed to setup the test server
script: phpunit --verbose -c tests/phpunit.xml
notifications:
email:
- [_YOUR_EMAIL_ADDRESS_]
- tests/phpunit.xml (path "tests" is optional but must match the path
tests/phpunit.xml
set in your .travis.yml)
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true">
<testsuites>
<testsuite name="simpleTest">
<file>tests/simpleTest.php</file>
</testsuite>
</testsuites>
</phpunit>
- tests/simpleTest.php (filepath must match the reference
<file>tests/simpleTest.php</file>
in phpunit.xml)
<?php
class FleximgTest extends PHPUnit_Framework_TestCase
{
public function test1()
{
$this->assertEqual(true,true);
}
/**
* @depends test1
*/
public function test2()
{
$this->assertEqual(false,false);
}
}
?>
##Templates
Some test environment setups
###Travis-ci - PHPUnit - Unit tests https://github.com/cioddi/travis-ci-phpunit-template
###Travis-ci - PHPUnit, Selenium - Functional tests https://github.com/cioddi/travis-ci-phpunit-selenium-template
###Travis-ci, Saucelabs - PHPUnit, Selenium - Functional tests https://github.com/cioddi/travis-ci-saucelabs-template