Permalink
Browse files

Prep work for Travis CI integration

  • Loading branch information...
1 parent 809bb19 commit 22823d021c1fbed529e7df9f48cbd727ca0f8107 @mbadolato mbadolato committed Apr 14, 2012
Showing with 77 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +22 −0 Tests/autoload.php.dist
  3. +7 −0 Tests/bootstrap.php
  4. +21 −0 phpunit.xml.dist
  5. +22 −0 vendor/vendors.php
View
@@ -0,0 +1,5 @@
+composer.lock
+phpunit.xml
+Tests/autoload.php
+vendor/*
+!vendor/vendors.php
@@ -0,0 +1,22 @@
+<?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' => $vendorDir.'/symfony/src',
+));
+$loader->register();
+
+spl_autoload_register(function($class) {
+ $class = ltrim($class, '\\');
+ if (0 === strpos($class, 'Cybernox\AmazonWebServicesBundle\\')) {
+ $file = __DIR__.'/../'.str_replace('\\', '/', substr($class, strlen('Cybernox\AmazonWebServicesBundle\\'))).'.php';
+ if (file_exists($file)) {
+ require $file;
+ }
+ }
+});
View
@@ -0,0 +1,7 @@
+<?php
+
+if (file_exists($file = __DIR__.'/autoload.php')) {
+ require_once $file;
+} elseif (file_exists($file = __DIR__.'/autoload.php.dist')) {
+ require_once $file;
+}
View
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<phpunit colors="true" bootstrap="Tests/bootstrap.php">
+ <testsuites>
+ <testsuite name="AmazonWebServicesBundle Test Suite">
+ <directory suffix="Test.php">./Tests/</directory>
+ </testsuite>
+ </testsuites>
+
+ <filter>
+ <whitelist>
+ <directory>./</directory>
+ <exclude>
+ <directory>./DataFixtures</directory>
+ <directory>./Resources</directory>
+ <directory>./Tests</directory>
+ <directory>./vendor</directory>
+ </exclude>
+ </whitelist>
+ </filter>
+</phpunit>
View
@@ -0,0 +1,22 @@
+#!/usr/bin/env php
+<?php
+
+set_time_limit(0);
+
+$vendorDir = __DIR__;
+$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 -q %s %s', escapeshellarg($url), escapeshellarg($installDir)));
+ }
+
+ system(sprintf('cd %s && git fetch -q origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
+}

0 comments on commit 22823d0

Please sign in to comment.