Configure Travis CI

This also changes the test suite and bootstrap to depend on packages installed by composer.
This commit is contained in:
Jeremy Mikola 2012-03-06 20:30:37 -05:00
parent 62c410f464
commit 0391dff44e
4 changed files with 39 additions and 14 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
phpunit.xml
vendor
composer.lock
composer.phar

12
.travis.yml Normal file
View file

@ -0,0 +1,12 @@
language: php
php:
- 5.3
- 5.4
before_script:
- wget -nc http://getcomposer.org/composer.phar
- php composer.phar install
script: phpunit --coverage-text

18
Tests/bootstrap.php Normal file
View file

@ -0,0 +1,18 @@
<?php
if (file_exists($file = __DIR__.'/../vendor/.composer/autoload.php')) {
$loader = require_once $file;
} else {
throw new RuntimeException('Install dependencies to run test suite.');
}
spl_autoload_register(function($class) {
if (0 === strpos($class, 'FOQ\\ElasticaBundle\\')) {
$path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
if (!stream_resolve_include_path($path)) {
return false;
}
require_once $path;
return true;
}
});

View file

@ -1,20 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="../../../../app/bootstrap.php.cache"
>
<phpunit bootstrap="./Tests/bootstrap.php" colors="true">
<testsuites>
<testsuite name="ElasticaBundle Test Suite">
<directory>./Tests/</directory>
<testsuite name="FOQElasticaBundle Test Suite">
<directory>./Tests</directory>
</testsuite>
</testsuites>
@ -22,7 +11,9 @@
<whitelist>
<directory>./</directory>
<exclude>
<directory>./Resources</directory>
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>