Permalink
Browse files

Add bootstrap

  • Loading branch information...
rande committed Apr 2, 2012
1 parent 2d35d2c commit e581ebeabaa069c190b8f3455fce87d97c9bae59
Showing with 61 additions and 0 deletions.
  1. +10 −0 .travis.yml
  2. +24 −0 Tests/autoload.php.dist
  3. +7 −0 Tests/bootstrap.php
  4. +20 −0 phpunit.xml.dist
View
@@ -0,0 +1,10 @@
+language: php
+php:
+ - 5.3
+ - 5.4
+
+env:
+ - SYMFONY_VERSION=v2.0.12
+ - SYMFONY_VERSION=origin/2.0
+
+before_script: php Tests/tests/vendors.php
View
@@ -0,0 +1,24 @@
+<?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
@@ -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,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<phpunit colors="true" bootstrap="./Tests/bootstrap.php" >
+ <testsuites>
+ <testsuite name="MonitorBundle Test Suite">
+ <directory suffix="Test.php">./Tests</directory>
+ </testsuite>
+ </testsuites>
+
+ <filter>
+ <whitelist>
+ <directory>./</directory>
+ <exclude>
+ <directory>./Tests/</directory>
+ <directory>./DataFixtures/</directory>
+ <directory>./Resources/</directory>
+ </exclude>
+ </whitelist>
+ </filter>
+</phpunit>

0 comments on commit e581ebe

Please sign in to comment.