diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | README.md | 15 | ||||
-rw-r--r-- | Tests/bootstrap.php | 30 | ||||
-rw-r--r-- | composer.json | 12 | ||||
-rw-r--r-- | phpunit.xml.dist | 2 |
5 files changed, 20 insertions, 41 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d1502b0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor/ +composer.lock @@ -18,16 +18,9 @@ Resources You can run the unit tests with the following command: - phpunit -c src/Symfony/Component/Security/ + phpunit If you also want to run the unit tests that depend on other Symfony -Components, declare the following environment variables before running -PHPUnit: - - export SYMFONY_HTTP_FOUNDATION=../path/to/HttpFoundation - export SYMFONY_HTTP_KERNEL=../path/to/HttpKernel - export SYMFONY_EVENT_DISPATCHER=../path/to/EventDispatcher - export SYMFONY_FORM=../path/to/Form - export SYMFONY_ROUTING=../path/to/Routing - export DOCTRINE_DBAL=../path/to/doctrine-dbal - export DOCTRINE_COMMON=../path/to/doctrine-common +Components, install dev dependencies before running PHPUnit: + + php composer.phar install --dev diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php index b154988..84ae3a6 100644 --- a/Tests/bootstrap.php +++ b/Tests/bootstrap.php @@ -10,35 +10,13 @@ */ spl_autoload_register(function ($class) { - foreach (array( - 'SYMFONY_HTTP_FOUNDATION' => 'HttpFoundation', - 'SYMFONY_HTTP_KERNEL' => 'HttpKernel', - 'SYMFONY_EVENT_DISPATCHER' => 'EventDispatcher', - 'SYMFONY_FORM' => 'Form', - 'SYMFONY_ROUTING' => 'Routing', - ) 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['DOCTRINE_DBAL']) && 0 === strpos(ltrim($class, '/'), 'Doctrine\DBAL')) { - if (file_exists($file = $_SERVER['DOCTRINE_DBAL'].'/lib/'.str_replace('\\', '/', $class).'.php')) { - require_once $file; - } - } - - if (isset($_SERVER['DOCTRINE_COMMON']) && 0 === strpos(ltrim($class, '/'), 'Doctrine\Common')) { - if (file_exists($file = $_SERVER['DOCTRINE_COMMON'].'/lib/'.str_replace('\\', '/', $class).'.php')) { - require_once $file; - } - } - if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Security')) { if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Security')).'.php')) { require_once $file; } } }); + +if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) { + require_once $loader; +} diff --git a/composer.json b/composer.json index 0dbade1..8619b57 100644 --- a/composer.json +++ b/composer.json @@ -17,9 +17,15 @@ ], "require": { "php": ">=5.3.2", - "symfony/event-dispatcher": "self.version", - "symfony/http-foundation": "self.version", - "symfony/http-kernel": "self.version" + "symfony/event-dispatcher": "2.1.*", + "symfony/http-foundation": "2.1.*", + "symfony/http-kernel": "2.1.*" + }, + "require-dev": { + "symfony/form": "2.1.*", + "symfony/routing": "2.1.*", + "doctrine/common": ">=2.1,<2.3-dev", + "doctrine/dbal": ">=2.1,<2.3-dev" }, "suggest": { "symfony/class-loader": "self.version", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7c9b67d..0560cf5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -21,7 +21,7 @@ <whitelist> <directory>./</directory> <exclude> - <directory>./Resources</directory> + <directory>./vendor</directory> <directory>./Tests</directory> </exclude> </whitelist> |