Permalink
Browse files

use composer for travis setup

  • Loading branch information...
1 parent 856bfd9 commit ad646d014c35641ca2545feb8866ef50e60bd6ad @lsmith77 lsmith77 committed Sep 24, 2012
Showing with 10 additions and 58 deletions.
  1. +5 −4 .travis.yml
  2. +0 −24 Tests/autoload.php.dist
  3. +5 −4 Tests/bootstrap.php
  4. +0 −26 Tests/vendors.php
View
9 .travis.yml
@@ -4,8 +4,9 @@ php:
- 5.4
env:
- - SYMFONY_VERSION=v2.0.12
- - SYMFONY_VERSION=origin/2.0
- - SYMFONY_VERSION=origin/master
+ - SYMFONY_VERSION=2.0.*
+ - SYMFONY_VERSION=2.1.*
+ - SYMFONY_VERSION=dev-master
-before_script: php Tests/vendors.php
+before_script:
+ - composer require symfony/framework-bundle:${SYMFONY_VERSION}
View
24 Tests/autoload.php.dist
@@ -1,24 +0,0 @@
-<?php
-
-$vendorDir = __DIR__.'/../vendor';
-require_once $vendorDir.'/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-
-use Symfony\Component\ClassLoader\UniversalClassLoader;
-
-$loader = new UniversalClassLoader();
-$loader->registerNamespaces(array(
- 'Symfony' => array($vendorDir.'/symfony/src'),
-));
-
-$loader->register();
-
-spl_autoload_register(function($class) {
- if (0 === strpos($class, 'Liip\\MonitorBundle\\')) {
- $path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
- if (!stream_resolve_include_path($path)) {
- return false;
- }
- require_once $path;
- return true;
- }
-});
View
9 Tests/bootstrap.php
@@ -1,7 +1,8 @@
<?php
-if (file_exists($file = __DIR__.'/autoload.php')) {
- require_once $file;
-} elseif (file_exists($file = __DIR__.'/autoload.php.dist')) {
- require_once $file;
+$file = __DIR__.'/../vendor/autoload.php';
+if (!file_exists($file)) {
+ throw new RuntimeException('Install dependencies to run test suite.');
}
+
+$autoload = require_once $file;
View
26 Tests/vendors.php
@@ -1,26 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-set_time_limit(0);
-
-$vendorDir = __DIR__.'/../vendor';
-if (!is_dir($vendorDir)) {
- mkdir($vendorDir);
-}
-
-$deps = array(
- array('symfony', 'git://github.com/symfony/symfony.git', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/master'),
-);
-
-foreach ($deps as $dep) {
- list($name, $url, $rev) = $dep;
-
- echo "> Installing/Updating $name\n";
-
- $installDir = $vendorDir.'/'.$name;
- if (!is_dir($installDir)) {
- system(sprintf('git clone --quiet %s %s', escapeshellarg($url), escapeshellarg($installDir)));
- }
-
- system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
-}

0 comments on commit ad646d0

Please sign in to comment.