diff --git a/src/Symfony/Component/BrowserKit/.gitignore b/src/Symfony/Component/BrowserKit/.gitignore
new file mode 100644
index 0000000000..d1502b087b
--- /dev/null
+++ b/src/Symfony/Component/BrowserKit/.gitignore
@@ -0,0 +1,2 @@
+vendor/
+composer.lock
diff --git a/src/Symfony/Component/BrowserKit/README.md b/src/Symfony/Component/BrowserKit/README.md
index 5ee4b58d69..061c2d7d6b 100644
--- a/src/Symfony/Component/BrowserKit/README.md
+++ b/src/Symfony/Component/BrowserKit/README.md
@@ -18,11 +18,9 @@ provided by the HttpKernel component.
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/BrowserKit/
+ phpunit
If you also want to run the unit tests that depend on other Symfony
-Components, declare the following environment variables before running
-PHPUnit:
+Components, install dev dependencies before running PHPUnit:
- export SYMFONY_PROCESS=../path/to/Process
- export SYMFONY_DOM_CRAWLER=../path/to/DomCrawler
+ php composer.phar install --dev
diff --git a/src/Symfony/Component/BrowserKit/Tests/bootstrap.php b/src/Symfony/Component/BrowserKit/Tests/bootstrap.php
index 3d03c34881..1b326ffd2e 100644
--- a/src/Symfony/Component/BrowserKit/Tests/bootstrap.php
+++ b/src/Symfony/Component/BrowserKit/Tests/bootstrap.php
@@ -10,21 +10,13 @@
*/
spl_autoload_register(function ($class) {
- foreach (array(
- 'SYMFONY_PROCESS' => 'Process',
- 'SYMFONY_DOM_CRAWLER' => 'DomCrawler',
- 'SYMFONY_CSS_SELECTOR' => 'CssSelector',
- ) 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 (0 === strpos(ltrim($class, '/'), 'Symfony\Component\BrowserKit')) {
if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\BrowserKit')).'.php')) {
require_once $file;
}
}
});
+
+if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) {
+ require_once $loader;
+}
diff --git a/src/Symfony/Component/BrowserKit/composer.json b/src/Symfony/Component/BrowserKit/composer.json
index a88cb18a87..ba225daea7 100644
--- a/src/Symfony/Component/BrowserKit/composer.json
+++ b/src/Symfony/Component/BrowserKit/composer.json
@@ -17,7 +17,11 @@
],
"require": {
"php": ">=5.3.2",
- "symfony/dom-crawler": "self.version"
+ "symfony/dom-crawler": "2.1.*"
+ },
+ "require-dev": {
+ "symfony/process": "2.1.*",
+ "symfony/css-selector": "2.1.*"
},
"suggest": {
"symfony/process": "self.version"
diff --git a/src/Symfony/Component/BrowserKit/phpunit.xml.dist b/src/Symfony/Component/BrowserKit/phpunit.xml.dist
index 68d5811cb9..0ddabeda0e 100644
--- a/src/Symfony/Component/BrowserKit/phpunit.xml.dist
+++ b/src/Symfony/Component/BrowserKit/phpunit.xml.dist
@@ -23,6 +23,7 @@
./Resources
./Tests
+ ./vendor
diff --git a/src/Symfony/Component/ClassLoader/.gitignore b/src/Symfony/Component/ClassLoader/.gitignore
new file mode 100644
index 0000000000..d1502b087b
--- /dev/null
+++ b/src/Symfony/Component/ClassLoader/.gitignore
@@ -0,0 +1,2 @@
+vendor/
+composer.lock
diff --git a/src/Symfony/Component/ClassLoader/README.md b/src/Symfony/Component/ClassLoader/README.md
index 5a83c5f3c1..64dffe9a68 100644
--- a/src/Symfony/Component/ClassLoader/README.md
+++ b/src/Symfony/Component/ClassLoader/README.md
@@ -64,10 +64,9 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/ClassLoader/
+ phpunit
If you also want to run the unit tests that depend on other Symfony
-Components, declare the following environment variables before running
-PHPUnit:
+Components, install dev dependencies before running PHPUnit:
- export SYMFONY_FINDER=../path/to/Finder
+ php composer.phar install --dev
diff --git a/src/Symfony/Component/ClassLoader/Tests/bootstrap.php b/src/Symfony/Component/ClassLoader/Tests/bootstrap.php
index 3364e147a1..54dac3fd26 100644
--- a/src/Symfony/Component/ClassLoader/Tests/bootstrap.php
+++ b/src/Symfony/Component/ClassLoader/Tests/bootstrap.php
@@ -10,19 +10,13 @@
*/
spl_autoload_register(function ($class) {
- foreach (array(
- 'SYMFONY_FINDER' => 'Finder',
- ) 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 (0 === strpos(ltrim($class, '/'), 'Symfony\Component\ClassLoader')) {
if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\ClassLoader')).'.php')) {
require_once $file;
}
}
});
+
+if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) {
+ require_once $loader;
+}
diff --git a/src/Symfony/Component/ClassLoader/composer.json b/src/Symfony/Component/ClassLoader/composer.json
index 2608f041a2..8f02c6df3f 100644
--- a/src/Symfony/Component/ClassLoader/composer.json
+++ b/src/Symfony/Component/ClassLoader/composer.json
@@ -18,6 +18,9 @@
"require": {
"php": ">=5.3.2"
},
+ "require-dev": {
+ "symfony/finder": "2.1.*"
+ },
"autoload": {
"psr-0": { "Symfony\\Component\\ClassLoader": "" }
},
diff --git a/src/Symfony/Component/ClassLoader/phpunit.xml.dist b/src/Symfony/Component/ClassLoader/phpunit.xml.dist
index bc7a21e8d4..ae7e2ad951 100644
--- a/src/Symfony/Component/ClassLoader/phpunit.xml.dist
+++ b/src/Symfony/Component/ClassLoader/phpunit.xml.dist
@@ -23,6 +23,7 @@
./Resources
./Tests
+ ./vendor
diff --git a/src/Symfony/Component/Config/README.md b/src/Symfony/Component/Config/README.md
index 7673045a8b..e87363df2d 100644
--- a/src/Symfony/Component/Config/README.md
+++ b/src/Symfony/Component/Config/README.md
@@ -11,4 +11,4 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/Config/
+ phpunit
diff --git a/src/Symfony/Component/Config/phpunit.xml.dist b/src/Symfony/Component/Config/phpunit.xml.dist
index a3601c6d95..e0195190ea 100644
--- a/src/Symfony/Component/Config/phpunit.xml.dist
+++ b/src/Symfony/Component/Config/phpunit.xml.dist
@@ -23,6 +23,7 @@
./Resources
./Tests
+ ./vendor
diff --git a/src/Symfony/Component/Console/README.md b/src/Symfony/Component/Console/README.md
index bfbfb91b6c..d81795219d 100644
--- a/src/Symfony/Component/Console/README.md
+++ b/src/Symfony/Component/Console/README.md
@@ -45,7 +45,7 @@ Tests
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/Console
+ phpunit
Resources
---------
diff --git a/src/Symfony/Component/Console/phpunit.xml.dist b/src/Symfony/Component/Console/phpunit.xml.dist
index 33ce09ebb5..fd1c069fea 100644
--- a/src/Symfony/Component/Console/phpunit.xml.dist
+++ b/src/Symfony/Component/Console/phpunit.xml.dist
@@ -23,6 +23,7 @@
./Resources
./Tests
+ ./vendor
diff --git a/src/Symfony/Component/CssSelector/README.md b/src/Symfony/Component/CssSelector/README.md
index 7fdaccfc55..0d7b840aa9 100644
--- a/src/Symfony/Component/CssSelector/README.md
+++ b/src/Symfony/Component/CssSelector/README.md
@@ -20,4 +20,4 @@ Current code is a port of http://codespeak.net/svn/lxml/trunk/src/lxml/cssselect
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/CssSelector/
+ phpunit
diff --git a/src/Symfony/Component/CssSelector/phpunit.xml.dist b/src/Symfony/Component/CssSelector/phpunit.xml.dist
index a0df044b2e..1aeb811580 100644
--- a/src/Symfony/Component/CssSelector/phpunit.xml.dist
+++ b/src/Symfony/Component/CssSelector/phpunit.xml.dist
@@ -23,6 +23,7 @@
./Resources
./Tests
+ ./vendor
diff --git a/src/Symfony/Component/DependencyInjection/.gitignore b/src/Symfony/Component/DependencyInjection/.gitignore
new file mode 100644
index 0000000000..d1502b087b
--- /dev/null
+++ b/src/Symfony/Component/DependencyInjection/.gitignore
@@ -0,0 +1,2 @@
+vendor/
+composer.lock
diff --git a/src/Symfony/Component/DependencyInjection/README.md b/src/Symfony/Component/DependencyInjection/README.md
index 3eb1a3b1f6..5cb62cf1c4 100644
--- a/src/Symfony/Component/DependencyInjection/README.md
+++ b/src/Symfony/Component/DependencyInjection/README.md
@@ -68,11 +68,9 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/DependencyInjection/
+ phpunit
If you also want to run the unit tests that depend on other Symfony
-Components, declare the following environment variables before running
-PHPUnit:
+Components, install dev dependencies before running PHPUnit:
- export SYMFONY_CONFIG=../path/to/Config
- export SYMFONY_YAML=../path/to/Yaml
+ php composer.phar install --dev
diff --git a/src/Symfony/Component/DependencyInjection/Tests/bootstrap.php b/src/Symfony/Component/DependencyInjection/Tests/bootstrap.php
index 77fe27526b..fd3118fc36 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/bootstrap.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/bootstrap.php
@@ -10,20 +10,13 @@
*/
spl_autoload_register(function ($class) {
- foreach (array(
- 'SYMFONY_CONFIG' => 'Config',
- 'SYMFONY_YAML' => 'Yaml',
- ) 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 (0 === strpos(ltrim($class, '/'), 'Symfony\Component\DependencyInjection')) {
if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\DependencyInjection')).'.php')) {
require_once $file;
}
}
});
+
+if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) {
+ require_once $loader;
+}
diff --git a/src/Symfony/Component/DependencyInjection/composer.json b/src/Symfony/Component/DependencyInjection/composer.json
index adf6f1109d..ffe6f6d399 100644
--- a/src/Symfony/Component/DependencyInjection/composer.json
+++ b/src/Symfony/Component/DependencyInjection/composer.json
@@ -18,6 +18,10 @@
"require": {
"php": ">=5.3.2"
},
+ "require-dev": {
+ "symfony/yaml": "2.1.*",
+ "symfony/config": "2.1.*"
+ },
"suggest": {
"symfony/yaml": "self.version",
"symfony/config": "self.version"
diff --git a/src/Symfony/Component/DependencyInjection/phpunit.xml.dist b/src/Symfony/Component/DependencyInjection/phpunit.xml.dist
index bb81f45c1b..554d1046b5 100644
--- a/src/Symfony/Component/DependencyInjection/phpunit.xml.dist
+++ b/src/Symfony/Component/DependencyInjection/phpunit.xml.dist
@@ -23,6 +23,7 @@
./Resources
./Tests
+ ./vendor
diff --git a/src/Symfony/Component/DomCrawler/.gitignore b/src/Symfony/Component/DomCrawler/.gitignore
new file mode 100644
index 0000000000..d1502b087b
--- /dev/null
+++ b/src/Symfony/Component/DomCrawler/.gitignore
@@ -0,0 +1,2 @@
+vendor/
+composer.lock
diff --git a/src/Symfony/Component/DomCrawler/README.md b/src/Symfony/Component/DomCrawler/README.md
index caa7013124..b383b5184b 100644
--- a/src/Symfony/Component/DomCrawler/README.md
+++ b/src/Symfony/Component/DomCrawler/README.md
@@ -27,10 +27,9 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/DomCrawler/
+ phpunit
If you also want to run the unit tests that depend on other Symfony
-Components, declare the following environment variables before running
-PHPUnit:
+Components, install dev dependencies before running PHPUnit:
- export SYMFONY_CSS_SELECTOR=../path/to/CssSelector
+ php composer.phar install --dev
diff --git a/src/Symfony/Component/DomCrawler/Tests/bootstrap.php b/src/Symfony/Component/DomCrawler/Tests/bootstrap.php
index 7fe6d607e1..78425f484a 100644
--- a/src/Symfony/Component/DomCrawler/Tests/bootstrap.php
+++ b/src/Symfony/Component/DomCrawler/Tests/bootstrap.php
@@ -10,19 +10,13 @@
*/
spl_autoload_register(function ($class) {
- foreach (array(
- 'SYMFONY_CSS_SELECTOR' => 'CssSelector',
- ) 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 (0 === strpos(ltrim($class, '/'), 'Symfony\Component\DomCrawler')) {
if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\DomCrawler')).'.php')) {
require_once $file;
}
}
});
+
+if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) {
+ require_once $loader;
+}
diff --git a/src/Symfony/Component/DomCrawler/composer.json b/src/Symfony/Component/DomCrawler/composer.json
index cbe2bce433..38b7f2f59e 100644
--- a/src/Symfony/Component/DomCrawler/composer.json
+++ b/src/Symfony/Component/DomCrawler/composer.json
@@ -18,6 +18,9 @@
"require": {
"php": ">=5.3.2"
},
+ "require-dev": {
+ "symfony/css-selector": "2.1.*"
+ },
"suggest": {
"symfony/css-selector": "self.version"
},
diff --git a/src/Symfony/Component/DomCrawler/phpunit.xml.dist b/src/Symfony/Component/DomCrawler/phpunit.xml.dist
index fede597027..1ee868ab54 100644
--- a/src/Symfony/Component/DomCrawler/phpunit.xml.dist
+++ b/src/Symfony/Component/DomCrawler/phpunit.xml.dist
@@ -23,6 +23,7 @@
./Resources
./Tests
+ ./vendor
diff --git a/src/Symfony/Component/EventDispatcher/.gitignore b/src/Symfony/Component/EventDispatcher/.gitignore
new file mode 100644
index 0000000000..d1502b087b
--- /dev/null
+++ b/src/Symfony/Component/EventDispatcher/.gitignore
@@ -0,0 +1,2 @@
+vendor/
+composer.lock
diff --git a/src/Symfony/Component/EventDispatcher/README.md b/src/Symfony/Component/EventDispatcher/README.md
index 421b8c6dec..a2bcfca1e3 100644
--- a/src/Symfony/Component/EventDispatcher/README.md
+++ b/src/Symfony/Component/EventDispatcher/README.md
@@ -20,11 +20,9 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/EventDispatcher/
+ phpunit
If you also want to run the unit tests that depend on other Symfony
-Components, declare the following environment variables before running
-PHPUnit:
+Components, install dev dependencies before running PHPUnit:
- export SYMFONY_DEPENDENCY_INJECTION=../path/to/DependencyInjection
- export SYMFONY_HTTP_KERNEL=../path/to/HttpKernel
+ php composer.phar install --dev
diff --git a/src/Symfony/Component/EventDispatcher/Tests/bootstrap.php b/src/Symfony/Component/EventDispatcher/Tests/bootstrap.php
index b71ee52866..033180fd3f 100644
--- a/src/Symfony/Component/EventDispatcher/Tests/bootstrap.php
+++ b/src/Symfony/Component/EventDispatcher/Tests/bootstrap.php
@@ -10,20 +10,13 @@
*/
spl_autoload_register(function ($class) {
- foreach (array(
- 'SYMFONY_DEPENDENCY_INJECTION' => 'DependencyInjection',
- 'SYMFONY_HTTP_KERNEL' => 'HttpKernel',
- ) 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 (0 === strpos(ltrim($class, '/'), 'Symfony\Component\EventDispatcher')) {
if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\EventDispatcher')).'.php')) {
require_once $file;
}
}
});
+
+if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) {
+ require_once $loader;
+}
diff --git a/src/Symfony/Component/EventDispatcher/composer.json b/src/Symfony/Component/EventDispatcher/composer.json
index d93d09f203..ce511397c8 100644
--- a/src/Symfony/Component/EventDispatcher/composer.json
+++ b/src/Symfony/Component/EventDispatcher/composer.json
@@ -18,6 +18,9 @@
"require": {
"php": ">=5.3.2"
},
+ "require-dev": {
+ "symfony/dependency-injection": "2.1.*"
+ },
"suggest": {
"symfony/dependency-injection": "self.version",
"symfony/http-kernel": "self.version"
diff --git a/src/Symfony/Component/EventDispatcher/phpunit.xml.dist b/src/Symfony/Component/EventDispatcher/phpunit.xml.dist
index cb261a4c1f..c5571353a6 100644
--- a/src/Symfony/Component/EventDispatcher/phpunit.xml.dist
+++ b/src/Symfony/Component/EventDispatcher/phpunit.xml.dist
@@ -23,6 +23,7 @@
./Resources
./Tests
+ ./vendor
diff --git a/src/Symfony/Component/Filesystem/README.md b/src/Symfony/Component/Filesystem/README.md
index 4768030ecd..e34bb8f05f 100644
--- a/src/Symfony/Component/Filesystem/README.md
+++ b/src/Symfony/Component/Filesystem/README.md
@@ -27,3 +27,9 @@ Filesystem provides basic utility to manipulate the file system:
$filesystem->isAbsolutePath($file);
+Resources
+---------
+
+You can run the unit tests with the following command:
+
+ phpunit
diff --git a/src/Symfony/Component/Filesystem/Tests/bootstrap.php b/src/Symfony/Component/Filesystem/Tests/bootstrap.php
new file mode 100644
index 0000000000..940c698450
--- /dev/null
+++ b/src/Symfony/Component/Filesystem/Tests/bootstrap.php
@@ -0,0 +1,18 @@
+
+ *
+ * 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\Filesystem')) {
+ if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Filesystem')).'.php')) {
+ require_once $file;
+ }
+ }
+});
diff --git a/src/Symfony/Component/Filesystem/phpunit.xml.dist b/src/Symfony/Component/Filesystem/phpunit.xml.dist
new file mode 100644
index 0000000000..5cd2dc961c
--- /dev/null
+++ b/src/Symfony/Component/Filesystem/phpunit.xml.dist
@@ -0,0 +1,28 @@
+
+
+
+
+
+ ./Tests/
+
+
+
+
+
+ ./
+
+ ./Tests
+
+
+
+
diff --git a/src/Symfony/Component/Finder/README.md b/src/Symfony/Component/Finder/README.md
index f71194f226..0c4516f7d6 100644
--- a/src/Symfony/Component/Finder/README.md
+++ b/src/Symfony/Component/Finder/README.md
@@ -35,4 +35,4 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/Finder/
+ phpunit
diff --git a/src/Symfony/Component/Finder/phpunit.xml.dist b/src/Symfony/Component/Finder/phpunit.xml.dist
index 4a802cfb85..cd116f5716 100644
--- a/src/Symfony/Component/Finder/phpunit.xml.dist
+++ b/src/Symfony/Component/Finder/phpunit.xml.dist
@@ -21,8 +21,8 @@
./
- ./Resources
./Tests
+ ./vendor
diff --git a/src/Symfony/Component/Form/.gitignore b/src/Symfony/Component/Form/.gitignore
new file mode 100644
index 0000000000..d1502b087b
--- /dev/null
+++ b/src/Symfony/Component/Form/.gitignore
@@ -0,0 +1,2 @@
+vendor/
+composer.lock
diff --git a/src/Symfony/Component/Form/README.md b/src/Symfony/Component/Form/README.md
index e98bad7b7d..f6ddf031aa 100644
--- a/src/Symfony/Component/Form/README.md
+++ b/src/Symfony/Component/Form/README.md
@@ -21,13 +21,9 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/Form/
+ phpunit
If you also want to run the unit tests that depend on other Symfony
-Components, declare the following environment variables before running
-PHPUnit:
+Components, install dev dependencies before running PHPUnit:
- export SYMFONY_EVENT_DISPATCHER=../path/to/EventDispatcher
- export SYMFONY_LOCALE=../path/to/Locale
- export SYMFONY_VALIDATOR=../path/to/Validator
- export SYMFONY_HTTP_FOUNDATION=../path/to/HttpFoundation
+ php composer.phar install --dev
diff --git a/src/Symfony/Component/Form/Tests/bootstrap.php b/src/Symfony/Component/Form/Tests/bootstrap.php
index 166add2c9e..902cefce5c 100644
--- a/src/Symfony/Component/Form/Tests/bootstrap.php
+++ b/src/Symfony/Component/Form/Tests/bootstrap.php
@@ -10,22 +10,13 @@
*/
spl_autoload_register(function ($class) {
- foreach (array(
- 'SYMFONY_EVENT_DISPATCHER' => 'EventDispatcher',
- 'SYMFONY_LOCALE' => 'Locale',
- 'SYMFONY_VALIDATOR' => 'Validator',
- '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 (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Form')) {
if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Form')).'.php')) {
require_once $file;
}
}
});
+
+if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) {
+ require_once $loader;
+}
diff --git a/src/Symfony/Component/Form/composer.json b/src/Symfony/Component/Form/composer.json
index b7ff0b4a51..9660d61159 100644
--- a/src/Symfony/Component/Form/composer.json
+++ b/src/Symfony/Component/Form/composer.json
@@ -17,8 +17,12 @@
],
"require": {
"php": ">=5.3.2",
- "symfony/event-dispatcher": "self.version",
- "symfony/locale": "self.version"
+ "symfony/event-dispatcher": "2.1.*",
+ "symfony/locale": "2.1.*"
+ },
+ "require-dev": {
+ "symfony/validator": "2.1.*",
+ "symfony/http-foundation": "2.1.*"
},
"suggest": {
"symfony/validator": "self.version",
diff --git a/src/Symfony/Component/Form/phpunit.xml.dist b/src/Symfony/Component/Form/phpunit.xml.dist
index d5d3827da1..0fd49c27e4 100644
--- a/src/Symfony/Component/Form/phpunit.xml.dist
+++ b/src/Symfony/Component/Form/phpunit.xml.dist
@@ -21,8 +21,8 @@
./
- ./Resources
./Tests
+ ./vendor
diff --git a/src/Symfony/Component/HttpFoundation/README.md b/src/Symfony/Component/HttpFoundation/README.md
index 8e5d8cfefd..bb6f02c443 100644
--- a/src/Symfony/Component/HttpFoundation/README.md
+++ b/src/Symfony/Component/HttpFoundation/README.md
@@ -43,4 +43,4 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/HttpFoundation/
+ phpunit
diff --git a/src/Symfony/Component/HttpFoundation/phpunit.xml.dist b/src/Symfony/Component/HttpFoundation/phpunit.xml.dist
index 95e0f03d82..2a760f290c 100644
--- a/src/Symfony/Component/HttpFoundation/phpunit.xml.dist
+++ b/src/Symfony/Component/HttpFoundation/phpunit.xml.dist
@@ -23,6 +23,7 @@
./Resources
./Tests
+ ./vendor
diff --git a/src/Symfony/Component/HttpKernel/.gitignore b/src/Symfony/Component/HttpKernel/.gitignore
new file mode 100644
index 0000000000..d1502b087b
--- /dev/null
+++ b/src/Symfony/Component/HttpKernel/.gitignore
@@ -0,0 +1,2 @@
+vendor/
+composer.lock
diff --git a/src/Symfony/Component/HttpKernel/README.md b/src/Symfony/Component/HttpKernel/README.md
index c592a42609..c44d530858 100644
--- a/src/Symfony/Component/HttpKernel/README.md
+++ b/src/Symfony/Component/HttpKernel/README.md
@@ -84,18 +84,9 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/HttpKernel/
+ phpunit
If you also want to run the unit tests that depend on other Symfony
-Components, declare the following environment variables before running
-PHPUnit:
+Components, install dev dependencies before running PHPUnit:
- export SYMFONY_EVENT_DISPATCHER=../path/to/EventDispatcher
- export SYMFONY_HTTP_FOUNDATION=../path/to/HttpFoundation
- export SYMFONY_DEPENDENCY_INJECTION=../path/to/DependencyInjection
- export SYMFONY_CONSOLE=../path/to/Console
- export SYMFONY_BROWSER_KIT=../path/to/BrowserKit
- export SYMFONY_FINDER=../path/to/Finder
- export SYMFONY_PROCESS=../path/to/Process
- export SYMFONY_ROUTING=../path/to/Routing
- export SYMFONY_CONFIG=../path/to/Config
+ php composer.phar install --dev
diff --git a/src/Symfony/Component/HttpKernel/Tests/bootstrap.php b/src/Symfony/Component/HttpKernel/Tests/bootstrap.php
index 2386a26e1b..24b1009e9a 100644
--- a/src/Symfony/Component/HttpKernel/Tests/bootstrap.php
+++ b/src/Symfony/Component/HttpKernel/Tests/bootstrap.php
@@ -10,28 +10,13 @@
*/
spl_autoload_register(function ($class) {
- foreach (array(
- 'SYMFONY_EVENT_DISPATCHER' => 'EventDispatcher',
- 'SYMFONY_HTTP_FOUNDATION' => 'HttpFoundation',
- 'SYMFONY_DEPENDENCY_INJECTION' => 'DependencyInjection',
- 'SYMFONY_CONSOLE' => 'Console',
- 'SYMFONY_BROWSER_KIT' => 'BrowserKit',
- 'SYMFONY_FINDER' => 'Finder',
- 'SYMFONY_CLASS_LOADER' => 'ClassLoader',
- 'SYMFONY_PROCESS' => 'Process',
- 'SYMFONY_ROUTING' => 'Routing',
- 'SYMFONY_CONFIG' => 'Config',
- ) 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 (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;
+}
diff --git a/src/Symfony/Component/HttpKernel/composer.json b/src/Symfony/Component/HttpKernel/composer.json
index 95fb176dc6..9976cd9b69 100644
--- a/src/Symfony/Component/HttpKernel/composer.json
+++ b/src/Symfony/Component/HttpKernel/composer.json
@@ -17,8 +17,18 @@
],
"require": {
"php": ">=5.3.2",
- "symfony/event-dispatcher": "self.version",
- "symfony/http-foundation": "self.version"
+ "symfony/event-dispatcher": "2.1.*",
+ "symfony/http-foundation": "2.1.*"
+ },
+ "require-dev": {
+ "symfony/browser-kit": "2.1.*",
+ "symfony/class-loader": "2.1.*",
+ "symfony/config": "2.1.*",
+ "symfony/console": "2.1.*",
+ "symfony/dependency-injection": "2.1.*",
+ "symfony/finder": "2.1.*",
+ "symfony/process": "2.1.*",
+ "symfony/routing": "2.1.*"
},
"suggest": {
"symfony/browser-kit": "self.version",
diff --git a/src/Symfony/Component/HttpKernel/phpunit.xml.dist b/src/Symfony/Component/HttpKernel/phpunit.xml.dist
index 0d881e1060..dd824acdf7 100644
--- a/src/Symfony/Component/HttpKernel/phpunit.xml.dist
+++ b/src/Symfony/Component/HttpKernel/phpunit.xml.dist
@@ -21,8 +21,8 @@
./
- ./Resources
./Tests
+ ./vendor
diff --git a/src/Symfony/Component/Locale/README.md b/src/Symfony/Component/Locale/README.md
index c3ee591d60..f7c2c4279a 100644
--- a/src/Symfony/Component/Locale/README.md
+++ b/src/Symfony/Component/Locale/README.md
@@ -19,4 +19,4 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/Locale/
+ phpunit
diff --git a/src/Symfony/Component/Locale/phpunit.xml.dist b/src/Symfony/Component/Locale/phpunit.xml.dist
index 7e3efc2e38..f6a1a6f65d 100644
--- a/src/Symfony/Component/Locale/phpunit.xml.dist
+++ b/src/Symfony/Component/Locale/phpunit.xml.dist
@@ -23,6 +23,7 @@
./Resources
./Tests
+ ./vendor
diff --git a/src/Symfony/Component/Process/README.md b/src/Symfony/Component/Process/README.md
index 005f59bb7c..2a8a4f764a 100644
--- a/src/Symfony/Component/Process/README.md
+++ b/src/Symfony/Component/Process/README.md
@@ -42,4 +42,4 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/Process/
+ phpunit
diff --git a/src/Symfony/Component/Process/phpunit.xml.dist b/src/Symfony/Component/Process/phpunit.xml.dist
index 7b68dd2d69..c120a97e91 100644
--- a/src/Symfony/Component/Process/phpunit.xml.dist
+++ b/src/Symfony/Component/Process/phpunit.xml.dist
@@ -21,7 +21,6 @@
./
- ./Resources
./Tests
diff --git a/src/Symfony/Component/Routing/.gitignore b/src/Symfony/Component/Routing/.gitignore
new file mode 100644
index 0000000000..d1502b087b
--- /dev/null
+++ b/src/Symfony/Component/Routing/.gitignore
@@ -0,0 +1,2 @@
+vendor/
+composer.lock
diff --git a/src/Symfony/Component/Routing/README.md b/src/Symfony/Component/Routing/README.md
index 63c398cfa6..61504c84d9 100644
--- a/src/Symfony/Component/Routing/README.md
+++ b/src/Symfony/Component/Routing/README.md
@@ -29,12 +29,9 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/Routing/
+ phpunit
If you also want to run the unit tests that depend on other Symfony
-Components, declare the following environment variables before running
-PHPUnit:
+Components, install dev dependencies before running PHPUnit:
- export SYMFONY_CONFIG=../path/to/Config
- export SYMFONY_YAML=../path/to/Yaml
- export DOCTRINE_COMMON=../path/to/doctrine-common
+ php composer.phar install --dev
diff --git a/src/Symfony/Component/Routing/Tests/bootstrap.php b/src/Symfony/Component/Routing/Tests/bootstrap.php
index 8565b3352d..23303c04bb 100644
--- a/src/Symfony/Component/Routing/Tests/bootstrap.php
+++ b/src/Symfony/Component/Routing/Tests/bootstrap.php
@@ -10,26 +10,13 @@
*/
spl_autoload_register(function ($class) {
- foreach (array(
- 'SYMFONY_CONFIG' => 'Config',
- 'SYMFONY_YAML' => 'Yaml',
- ) 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_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\Routing')) {
if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Routing')).'.php')) {
require_once $file;
}
}
});
+
+if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) {
+ require_once $loader;
+}
diff --git a/src/Symfony/Component/Routing/composer.json b/src/Symfony/Component/Routing/composer.json
index fb0af2d6a1..abcb464c1d 100644
--- a/src/Symfony/Component/Routing/composer.json
+++ b/src/Symfony/Component/Routing/composer.json
@@ -18,9 +18,15 @@
"require": {
"php": ">=5.3.2"
},
+ "require-dev": {
+ "symfony/config": "2.1.*",
+ "symfony/yaml": "2.1.*",
+ "doctrine/common": ">=2.1,<2.3-dev"
+ },
"suggest": {
"symfony/config": "self.version",
- "symfony/yaml": "self.version"
+ "symfony/yaml": "self.version",
+ "doctrine/common": ">=2.1,<2.3-dev"
},
"autoload": {
"psr-0": { "Symfony\\Component\\Routing": "" }
diff --git a/src/Symfony/Component/Routing/phpunit.xml.dist b/src/Symfony/Component/Routing/phpunit.xml.dist
index f6d9ede400..6d25ebf91f 100644
--- a/src/Symfony/Component/Routing/phpunit.xml.dist
+++ b/src/Symfony/Component/Routing/phpunit.xml.dist
@@ -21,7 +21,7 @@
./
- ./Resources
+ ./vendor
./Tests
diff --git a/src/Symfony/Component/Security/.gitignore b/src/Symfony/Component/Security/.gitignore
new file mode 100644
index 0000000000..d1502b087b
--- /dev/null
+++ b/src/Symfony/Component/Security/.gitignore
@@ -0,0 +1,2 @@
+vendor/
+composer.lock
diff --git a/src/Symfony/Component/Security/README.md b/src/Symfony/Component/Security/README.md
index ca3b710e94..7ae97b1030 100644
--- a/src/Symfony/Component/Security/README.md
+++ b/src/Symfony/Component/Security/README.md
@@ -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:
+Components, install dev dependencies 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
+ php composer.phar install --dev
diff --git a/src/Symfony/Component/Security/Tests/bootstrap.php b/src/Symfony/Component/Security/Tests/bootstrap.php
index b1549882de..84ae3a6788 100644
--- a/src/Symfony/Component/Security/Tests/bootstrap.php
+++ b/src/Symfony/Component/Security/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/src/Symfony/Component/Security/composer.json b/src/Symfony/Component/Security/composer.json
index 0dbade1277..8619b571ea 100644
--- a/src/Symfony/Component/Security/composer.json
+++ b/src/Symfony/Component/Security/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/src/Symfony/Component/Security/phpunit.xml.dist b/src/Symfony/Component/Security/phpunit.xml.dist
index 7c9b67ddd6..0560cf5334 100644
--- a/src/Symfony/Component/Security/phpunit.xml.dist
+++ b/src/Symfony/Component/Security/phpunit.xml.dist
@@ -21,7 +21,7 @@
./
- ./Resources
+ ./vendor
./Tests
diff --git a/src/Symfony/Component/Serializer/README.md b/src/Symfony/Component/Serializer/README.md
index 0298bcb370..df74a9a001 100644
--- a/src/Symfony/Component/Serializer/README.md
+++ b/src/Symfony/Component/Serializer/README.md
@@ -10,4 +10,4 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/Serializer/
+ phpunit
diff --git a/src/Symfony/Component/Serializer/phpunit.xml.dist b/src/Symfony/Component/Serializer/phpunit.xml.dist
index 8b4fcea597..c85ffa717a 100644
--- a/src/Symfony/Component/Serializer/phpunit.xml.dist
+++ b/src/Symfony/Component/Serializer/phpunit.xml.dist
@@ -21,7 +21,7 @@
./
- ./Resources
+ ./vendor
./Tests
diff --git a/src/Symfony/Component/Templating/README.md b/src/Symfony/Component/Templating/README.md
index e3487f376e..55d9c69e3d 100644
--- a/src/Symfony/Component/Templating/README.md
+++ b/src/Symfony/Component/Templating/README.md
@@ -13,4 +13,4 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/Templating/
+ phpunit
diff --git a/src/Symfony/Component/Templating/phpunit.xml.dist b/src/Symfony/Component/Templating/phpunit.xml.dist
index f0e0427573..0fc73521c5 100644
--- a/src/Symfony/Component/Templating/phpunit.xml.dist
+++ b/src/Symfony/Component/Templating/phpunit.xml.dist
@@ -21,7 +21,7 @@
./
- ./Resources
+ ./vendor
./Tests
diff --git a/src/Symfony/Component/Translation/.gitignore b/src/Symfony/Component/Translation/.gitignore
new file mode 100644
index 0000000000..d1502b087b
--- /dev/null
+++ b/src/Symfony/Component/Translation/.gitignore
@@ -0,0 +1,2 @@
+vendor/
+composer.lock
diff --git a/src/Symfony/Component/Translation/README.md b/src/Symfony/Component/Translation/README.md
index 22b23529af..c5dd05222e 100644
--- a/src/Symfony/Component/Translation/README.md
+++ b/src/Symfony/Component/Translation/README.md
@@ -30,11 +30,9 @@ http://symfony.com/doc/2.0/book/translation.html
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/Translation/
+ phpunit
If you also want to run the unit tests that depend on other Symfony
-Components, declare the following environment variables before running
-PHPUnit:
+Components, install dev dependencies before running PHPUnit:
- export SYMFONY_CONFIG=../path/to/Config
- export SYMFONY_YAML=../path/to/Yaml
+ php composer.phar install --dev
diff --git a/src/Symfony/Component/Translation/Tests/bootstrap.php b/src/Symfony/Component/Translation/Tests/bootstrap.php
index 373bf06ed5..c203e99979 100644
--- a/src/Symfony/Component/Translation/Tests/bootstrap.php
+++ b/src/Symfony/Component/Translation/Tests/bootstrap.php
@@ -10,20 +10,13 @@
*/
spl_autoload_register(function ($class) {
- foreach (array(
- 'SYMFONY_CONFIG' => 'Config',
- 'SYMFONY_YAML' => 'Yaml',
- ) 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 (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Translation')) {
if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Translation')).'.php')) {
require_once $file;
}
}
});
+
+if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) {
+ require_once $loader;
+}
diff --git a/src/Symfony/Component/Translation/composer.json b/src/Symfony/Component/Translation/composer.json
index c71ee77cdf..d6217f171c 100644
--- a/src/Symfony/Component/Translation/composer.json
+++ b/src/Symfony/Component/Translation/composer.json
@@ -18,6 +18,10 @@
"require": {
"php": ">=5.3.2"
},
+ "require-dev": {
+ "symfony/config": "2.1.*",
+ "symfony/yaml": "2.1.*"
+ },
"suggest": {
"symfony/config": "self.version",
"symfony/yaml": "self.version"
diff --git a/src/Symfony/Component/Translation/phpunit.xml.dist b/src/Symfony/Component/Translation/phpunit.xml.dist
index 2f76fcb416..65542f6a89 100644
--- a/src/Symfony/Component/Translation/phpunit.xml.dist
+++ b/src/Symfony/Component/Translation/phpunit.xml.dist
@@ -21,7 +21,7 @@
./
- ./Resources
+ ./vendor
./Tests
diff --git a/src/Symfony/Component/Validator/.gitignore b/src/Symfony/Component/Validator/.gitignore
new file mode 100644
index 0000000000..d1502b087b
--- /dev/null
+++ b/src/Symfony/Component/Validator/.gitignore
@@ -0,0 +1,2 @@
+vendor/
+composer.lock
diff --git a/src/Symfony/Component/Validator/README.md b/src/Symfony/Component/Validator/README.md
index 911beaf815..291a672068 100644
--- a/src/Symfony/Component/Validator/README.md
+++ b/src/Symfony/Component/Validator/README.md
@@ -47,13 +47,9 @@ http://jcp.org/en/jsr/detail?id=303
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/Validator/
+ phpunit
If you also want to run the unit tests that depend on other Symfony
-Components, declare the following environment variables before running
-PHPUnit:
+Components, install dev dependencies before running PHPUnit:
- export SYMFONY_YAML=../path/to/Yaml
- export SYMFONY_LOCALE=../path/to/Locale
- export SYMFONY_HTTP_FOUNDATION=../path/to/HttpFoundation
- export DOCTRINE_COMMON=../path/to/doctrine-common
+ php composer.phar install --dev
diff --git a/src/Symfony/Component/Validator/Tests/bootstrap.php b/src/Symfony/Component/Validator/Tests/bootstrap.php
index 31ccc9a269..be500e8642 100644
--- a/src/Symfony/Component/Validator/Tests/bootstrap.php
+++ b/src/Symfony/Component/Validator/Tests/bootstrap.php
@@ -9,25 +9,7 @@
* file that was distributed with this source code.
*/
-spl_autoload_register($loader = function ($class) {
- foreach (array(
- 'SYMFONY_YAML' => 'Yaml',
- 'SYMFONY_LOCALE' => 'Locale',
- '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['DOCTRINE_COMMON']) && 0 === strpos(ltrim($class, '/'), 'Doctrine\Common')) {
- if (file_exists($file = $_SERVER['DOCTRINE_COMMON'].'/lib/'.str_replace('\\', '/', $class).'.php')) {
- require_once $file;
- }
- }
-
+spl_autoload_register(function ($class) {
if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Validator')) {
if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Validator')).'.php')) {
require_once $file;
@@ -35,9 +17,17 @@ spl_autoload_register($loader = function ($class) {
}
});
-if (isset($_SERVER['DOCTRINE_COMMON'])) {
- Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(function($class) use ($loader) {
- $loader($class);
+if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) {
+ require_once $loader;
+}
+
+if (class_exists($annotationRegistry = 'Doctrine\Common\Annotations\AnnotationRegistry')) {
+ $annotationRegistry::registerLoader(function($class) {
+ if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Validator')) {
+ if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Validator')).'.php')) {
+ require_once $file;
+ }
+ }
return class_exists($class, false);
});
diff --git a/src/Symfony/Component/Validator/composer.json b/src/Symfony/Component/Validator/composer.json
index 7e2959ee80..8d25c78f0d 100644
--- a/src/Symfony/Component/Validator/composer.json
+++ b/src/Symfony/Component/Validator/composer.json
@@ -19,6 +19,11 @@
"php": ">=5.3.2",
"doctrine/common": ">=2.1,<2.3"
},
+ "require-dev": {
+ "symfony/http-foundation": "2.1.*",
+ "symfony/locale": "2.1.*",
+ "symfony/yaml": "2.1.*"
+ },
"suggest": {
"symfony/http-foundation": "self.version",
"symfony/yaml": "self.version"
diff --git a/src/Symfony/Component/Validator/phpunit.xml.dist b/src/Symfony/Component/Validator/phpunit.xml.dist
index ce3da0c46e..a29586c86b 100644
--- a/src/Symfony/Component/Validator/phpunit.xml.dist
+++ b/src/Symfony/Component/Validator/phpunit.xml.dist
@@ -21,7 +21,7 @@
./
- ./Resources
+ ./vendor
./Tests
diff --git a/src/Symfony/Component/Yaml/README.md b/src/Symfony/Component/Yaml/README.md
index 93f1efdaed..3441316699 100644
--- a/src/Symfony/Component/Yaml/README.md
+++ b/src/Symfony/Component/Yaml/README.md
@@ -14,4 +14,4 @@ Resources
You can run the unit tests with the following command:
- phpunit -c src/Symfony/Component/Yaml/
+ phpunit
diff --git a/src/Symfony/Component/Yaml/phpunit.xml.dist b/src/Symfony/Component/Yaml/phpunit.xml.dist
index 85e540a7d7..d025f9e49a 100644
--- a/src/Symfony/Component/Yaml/phpunit.xml.dist
+++ b/src/Symfony/Component/Yaml/phpunit.xml.dist
@@ -21,7 +21,7 @@
./
- ./Resources
+ ./vendor
./Tests