Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Configure Travis CI

This also changes the test suite and bootstrap to depend on packages installed by composer.
  • Loading branch information...
commit 0391dff44eb73180af8c4279c8c8975bc90206ae 1 parent 62c410f
@jmikola jmikola authored
Showing with 39 additions and 14 deletions.
  1. +4 −0 .gitignore
  2. +12 −0 .travis.yml
  3. +18 −0 Tests/bootstrap.php
  4. +5 −14 phpunit.xml.dist
View
4 .gitignore
@@ -0,0 +1,4 @@
+phpunit.xml
+vendor
+composer.lock
+composer.phar
View
12 .travis.yml
@@ -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
+
View
18 Tests/bootstrap.php
@@ -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
19 phpunit.xml.dist
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.