Permalink
Please sign in to comment.
Showing
with
81 additions
and 82 deletions.
- +4 −2 .gitignore
- +11 −0 .travis.yml
- +23 −0 Tests/autoload.php.dist
- +5 −18 Tests/bootstrap.php
- +14 −20 phpunit.xml.dist
- +24 −0 vendor/vendors.php
- +0 −42 vendors.php
@@ -1,3 +1,5 @@ | ||
/phpunit.xml | ||
-/autoload.php | ||
-/vendor | ||
+/Tests/autoload.php | ||
+/vendor/doctrine-common | ||
+/vendor/doctrine-dbal | ||
+/vendor/symfony |
11
.travis.yml
@@ -0,0 +1,11 @@ | ||
+language: php | ||
+ | ||
+php: | ||
+ - 5.3 | ||
+ - 5.4 | ||
+ | ||
+env: | ||
+ - SYMFONY_VERSION=v2.0.6 | ||
+ - SYMFONY_VERSION=origin/master | ||
+ | ||
+before_script: php vendor/vendors.php |
@@ -0,0 +1,23 @@ | ||
+<?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', | ||
+ 'Doctrine\\Common' => $vendorDir.'/doctrine-common/lib', | ||
+ 'Doctrine\\DBAL' => $vendorDir.'/doctrine-dbal/lib', | ||
+)); | ||
+$loader->register(); | ||
+ | ||
+spl_autoload_register(function($class) { | ||
+ if (0 === strpos($class, 'BeSimple\\I18nRoutingBundle\\')) { | ||
+ $path = implode('/', array_slice(explode('\\', $class), 2)).'.php'; | ||
+ require_once __DIR__.'/../'.$path; | ||
+ | ||
+ return true; | ||
+ } | ||
+}); |
@@ -1,20 +1,7 @@ | ||
<?php | ||
-require_once $_SERVER['SYMFONY'].'/Symfony/Component/ClassLoader/UniversalClassLoader.php'; | ||
- | ||
-use Symfony\Component\ClassLoader\UniversalClassLoader; | ||
- | ||
-$loader = new UniversalClassLoader(); | ||
-$loader->registerNamespace('Symfony', $_SERVER['SYMFONY']); | ||
-$loader->registerNamespace('Doctrine\\DBAL', $_SERVER['DOCTRINE_DBAL']); | ||
-$loader->registerNamespace('Doctrine\\Common', $_SERVER['DOCTRINE_COMMON']); | ||
-$loader->register(); | ||
- | ||
-spl_autoload_register(function($class) { | ||
- if (0 === strpos($class, 'BeSimple\\I18nRoutingBundle\\')) { | ||
- $path = implode('/', array_slice(explode('\\', $class), 2)).'.php'; | ||
- require_once __DIR__.'/../'.$path; | ||
- | ||
- return true; | ||
- } | ||
-}); | ||
+if (file_exists($file = __DIR__.'/autoload.php')) { | ||
+ require_once $file; | ||
+} elseif (file_exists($file = __DIR__.'/autoload.php.dist')) { | ||
+ require_once $file; | ||
+} |
@@ -1,25 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
- | ||
-<phpunit backupGlobals="false" | ||
- backupStaticAttributes="false" | ||
- colors="true" | ||
- convertErrorsToExceptions="true" | ||
- convertNoticesToExceptions="true" | ||
- convertWarningsToExceptions="true" | ||
- processIsolation="false" | ||
- stopOnFailure="false" | ||
- syntaxCheck="false" | ||
- bootstrap="tests/bootstrap.php" | ||
-> | ||
- <php> | ||
- <server name="SYMFONY" value="./vendor/symfony/src" /> | ||
- <server name="DOCTRINE_DBAL" value="./vendor/doctrine-dbal/lib" /> | ||
- <server name="DOCTRINE_COMMON" value="./vendor/doctrine-common/lib" /> | ||
- </php> | ||
- | ||
+<phpunit colors="true" bootstrap="./Tests/bootstrap.php"> | ||
<testsuites> | ||
- <testsuite name="I18nRoutingBundle Test Suite"> | ||
- <directory>./Tests/</directory> | ||
+ <testsuite name="BesimpleI18nRoutingBundle Test Suite"> | ||
+ <directory suffix="Test.php">./Tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
+ | ||
+ <filter> | ||
+ <whitelist> | ||
+ <directory>./</directory> | ||
+ <exclude> | ||
+ <directory>./Resources</directory> | ||
+ <directory>./Tests</directory> | ||
+ <directory>./vendor</directory> | ||
+ </exclude> | ||
+ </whitelist> | ||
+ </filter> | ||
</phpunit> |
@@ -0,0 +1,24 @@ | ||
+#!/usr/bin/env php | ||
+<?php | ||
+ | ||
+set_time_limit(0); | ||
+ | ||
+$vendorDir = __DIR__; | ||
+$deps = array( | ||
+ array('symfony', 'http://github.com/symfony/symfony', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/master'), | ||
+ array('doctrine-common', 'http://github.com/doctrine/common.git', 'origin/master'), | ||
+ array('doctrine-dbal', 'http://github.com/doctrine/dbal.git', '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))); | ||
+} |
42
vendors.php
@@ -1,42 +0,0 @@ | ||
-#!/usr/bin/env php | ||
-<?php | ||
- | ||
-/* | ||
- * This file is part of the Symfony framework. | ||
- * | ||
- * (c) Fabien Potencier <fabien@symfony.com> | ||
- * | ||
- * For the full copyright and license information, please view the LICENSE | ||
- * file that was distributed with this source code. | ||
- */ | ||
- | ||
-/* | ||
- | ||
-CAUTION: This file installs the dependencies needed to run the I18nRoutingBundle test suite. | ||
- | ||
-https://github.com/BeSimple/I18nRoutingBundle | ||
- | ||
-*/ | ||
- | ||
-if (!is_dir($vendorDir = dirname(__FILE__).'/vendor')) { | ||
- mkdir($vendorDir, 0777, true); | ||
-} | ||
- | ||
-$deps = array( | ||
- array('symfony', 'http://github.com/symfony/symfony.git', 'origin/HEAD'), | ||
- array('doctrine-common', 'http://github.com/doctrine/common.git', 'origin/HEAD'), | ||
- array('doctrine-dbal', 'http://github.com/doctrine/dbal.git', 'origin/HEAD'), | ||
-); | ||
- | ||
-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 %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
5abd869