Configure Travis CI
This also changes the test suite and bootstrap to depend on packages installed by composer.
This commit is contained in:
parent
62c410f464
commit
0391dff44e
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
phpunit.xml
|
||||||
|
vendor
|
||||||
|
composer.lock
|
||||||
|
composer.phar
|
12
.travis.yml
Normal file
12
.travis.yml
Normal 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
18
Tests/bootstrap.php
Normal 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;
|
||||||
|
}
|
||||||
|
});
|
|
@ -1,20 +1,9 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit backupGlobals="false"
|
<phpunit bootstrap="./Tests/bootstrap.php" colors="true">
|
||||||
backupStaticAttributes="false"
|
|
||||||
colors="false"
|
|
||||||
convertErrorsToExceptions="true"
|
|
||||||
convertNoticesToExceptions="true"
|
|
||||||
convertWarningsToExceptions="true"
|
|
||||||
processIsolation="false"
|
|
||||||
stopOnFailure="false"
|
|
||||||
syntaxCheck="false"
|
|
||||||
bootstrap="../../../../app/bootstrap.php.cache"
|
|
||||||
>
|
|
||||||
|
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="ElasticaBundle Test Suite">
|
<testsuite name="FOQElasticaBundle Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
|
|
||||||
|
@ -22,7 +11,9 @@
|
||||||
<whitelist>
|
<whitelist>
|
||||||
<directory>./</directory>
|
<directory>./</directory>
|
||||||
<exclude>
|
<exclude>
|
||||||
|
<directory>./Resources</directory>
|
||||||
<directory>./Tests</directory>
|
<directory>./Tests</directory>
|
||||||
|
<directory>./vendor</directory>
|
||||||
</exclude>
|
</exclude>
|
||||||
</whitelist>
|
</whitelist>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
Loading…
Reference in a new issue