Permalink
Browse files

fixed travis tests

  • Loading branch information...
everzet committed Dec 28, 2011
1 parent 11e0fb6 commit bde818f8b53365a26c9e4bd6c0c822528c5e7b04
Showing with 40 additions and 5 deletions.
  1. +3 −4 .travis.yml
  2. +36 −0 Tests/bootstrap.php
  3. +1 −1 phpunit.xml.dist
View
@@ -4,10 +4,9 @@ php:
- 5.3
- 5.4
-env:
- - SYMFONY_VERSION=origin/master
-
-before_script: php vendor/vendors.php
+before_script:
+ - wget -nc http://getcomposer.org/composer.phar
+ - php composer.phar install
script: phpunit --coverage-text
View
@@ -0,0 +1,36 @@
+<?php
+
+/*
+ * This file is part of the FOSRestBundle package.
+ *
+ * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+if (file_exists($file = __DIR__.'/../vendor/.composer/autoload.php')) {
+ $autoload = require_once $file;
+} else {
+ throw new RuntimeException('Install dependencies to run test suite.');
+}
+
+spl_autoload_register(function($class) {
+ if (0 === strpos($class, 'FOS\\RestBundle\\')) {
+ $path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
+ if (!stream_resolve_include_path($path)) {
+ return false;
+ }
+ require_once $path;
+ return true;
+ }
+});
+
+use Doctrine\Common\Annotations\AnnotationRegistry;
+AnnotationRegistry::registerLoader(function($class) {
+ if (strpos($class, 'FOS\RestBundle\Controller\Annotations\\') === 0) {
+ $path = __DIR__.'/../'.str_replace('\\', '/', substr($class, strlen('FOS\RestBundle\\'))) .'.php';
+ require_once $path;
+ }
+ return class_exists($class, false);
+});
View
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<phpunit bootstrap="./vendor/.composer/autoload.php" colors="true">
+<phpunit bootstrap="./Tests/bootstrap.php" colors="true">
<testsuites>
<testsuite name="FOSRestBundle test suite">

0 comments on commit bde818f

Please sign in to comment.