Permalink
Browse files

made usage of Composer autoloader for subtree-split unit tests

  • Loading branch information...
1 parent 8bb110e commit 4b765b4b60dbc84205e6467d3ae7c64c91adc66a @fabpot fabpot committed Nov 9, 2012
Showing with 7 additions and 30 deletions.
  1. +2 −0 .gitignore
  2. +3 −6 README.md
  3. +1 −1 Tests/Fixtures/TestClient.php
  4. +0 −22 Tests/bootstrap.php
  5. +1 −1 phpunit.xml.dist
View
@@ -1,2 +1,4 @@
vendor/
composer.lock
+phpunit.xml
+
View
@@ -84,9 +84,6 @@ Resources
You can run the unit tests with the following command:
- phpunit
-
-If you also want to run the unit tests that depend on other Symfony
-Components, install dev dependencies before running PHPUnit:
-
- php composer.phar install --dev
+ $ cd path/to/Symfony/Component/HttpKernel/
+ $ composer.phar install --dev
+ $ phpunit
@@ -19,7 +19,7 @@ protected function getScript($request)
{
$script = parent::getScript($request);
- $script = preg_replace('/(\->register\(\);)/', "$0\nrequire_once '".__DIR__."/../bootstrap.php';", $script);
+ $script = preg_replace('/(\->register\(\);)/', "$0\nrequire_once '".__DIR__."/../../vendor/autoload.php';", $script);
return $script;
}
View
@@ -1,22 +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) {
- if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\HttpKernel')) {
- if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\HttpKernel')).'.php')) {
- require_once $file;
- }
- }
-});
-
-if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) {
- require_once $loader;
-}
View
@@ -9,7 +9,7 @@
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
- bootstrap="Tests/bootstrap.php"
+ bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="Symfony HttpKernel Component Test Suite">

0 comments on commit 4b765b4

Please sign in to comment.