Permalink
Browse files

made usage of Composer autoloader for subtree-split unit tests

  • Loading branch information...
1 parent 61c1551 commit cba106ac4d0a9d9d7c543d4e71acd8e94cefab68 @fabpot fabpot committed Nov 9, 2012
Showing with 10 additions and 26 deletions.
  1. +4 −0 .gitignore
  2. +3 −1 README.md
  3. +1 −1 Tests/BinaryFileResponseTest.php
  4. +0 −22 Tests/bootstrap.php
  5. +1 −1 composer.json
  6. +1 −1 phpunit.xml.dist
View
@@ -0,0 +1,4 @@
+vendor/
+composer.lock
+phpunit.xml
+
View
@@ -43,4 +43,6 @@ Resources
You can run the unit tests with the following command:
- phpunit
+ $ cd path/to/Symfony/Component/HttpFoundation/
+ $ composer.phar install --dev
+ $ phpunit
@@ -49,7 +49,7 @@ public function testGetContent()
public function testRequests()
{
- $response = BinaryFileResponse::create('src/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test.gif')->setAutoEtag();
+ $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif')->setAutoEtag();
// do a request to get the ETag
$request = Request::create('/');
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 (ltrim('SessionHandlerInterface', '/') === $class) {
- require_once __DIR__.'/../Resources/stubs/SessionHandlerInterface.php';
- }
-
- if (0 !== strpos(ltrim($class, '/'), 'Symfony\Component\HttpFoundation')) {
- return;
- }
-
- require_once __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\HttpFoundation')).'.php';
-});
View
@@ -20,7 +20,7 @@
},
"autoload": {
"psr-0": { "Symfony\\Component\\HttpFoundation\\": "" },
- "classmap": [ "Symfony/Component/HttpFoundation/Resources/stubs" ]
+ "classmap": [ "Symfony/Component/HttpFoundation/Resources/Resources/stubs" ]
},
"target-dir": "Symfony/Component/HttpFoundation",
"minimum-stability": "dev",
View
@@ -9,7 +9,7 @@
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
- bootstrap="Tests/bootstrap.php"
+ bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="Symfony HttpFoundation Component Test Suite">

0 comments on commit cba106a

Please sign in to comment.