Permalink
Browse files

made usage of Composer autoloader for subtree-split unit tests

  • Loading branch information...
1 parent a2ad9ff commit 72f39628d8aed6d254953178f80e958b47ce92b5 @fabpot fabpot committed Nov 9, 2012
Showing with 8 additions and 43 deletions.
  1. +4 −0 .gitignore
  2. +3 −8 README.md
  3. +0 −34 Tests/bootstrap.php
  4. +1 −1 phpunit.xml.dist
View
@@ -0,0 +1,4 @@
+vendor/
+composer.lock
+phpunit.xml
+
View
@@ -8,11 +8,6 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Bridge/Monolog/
-
-If you also want to run the unit tests that depend on other Symfony
-Components, declare the following environment variables before running
-PHPUnit:
-
- export MONOLOG=../path/to/Monolog
- export SYMFONY_HTTP_FOUNDATION=../path/to/HttpFoundation
+ $ cd path/to/Symfony/Bridge/Monolog/
+ $ composer.phar install --dev
+ $ phpunit
View
@@ -1,34 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (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.
- */
-
-spl_autoload_register(function ($class) {
- foreach (array(
- 'SYMFONY_HTTP_FOUNDATION' => 'HttpFoundation',
- ) as $env => $name) {
- if (isset($_SERVER[$env]) && 0 === strpos(ltrim($class, '/'), 'Symfony\Component\\'.$name)) {
- if (file_exists($file = $_SERVER[$env].'/'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\\'.$name)).'.php')) {
- require_once $file;
- }
- }
- }
-
- if (isset($_SERVER['MONOLOG']) && 0 === strpos(ltrim($class, '/'), 'Monolog')) {
- if (file_exists($file = $_SERVER['MONOLOG'].'/src/'.str_replace('\\', '/', $class).'.php')) {
- require_once $file;
- }
- }
-
- if (0 === strpos(ltrim($class, '/'), 'Symfony\Bridge\Monolog')) {
- if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Bridge\Monolog')).'.php')) {
- require_once $file;
- }
- }
-});
View
@@ -9,7 +9,7 @@
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
- bootstrap="tests/bootstrap.php"
+ bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="Symfony Monolog Bridge Test Suite">

0 comments on commit 72f3962

Please sign in to comment.