Permalink
Browse files

merged branch willdurand/fix-components (PR #4155)

Commits
-------

c195957 [Components] Tests/Autoloading fixes

Discussion
----------

Fix components

See #4141

----
This PR:

* configures each component to use composer to manage "dev" dependencies instead of env variables;
* adds phpunit configuration file on Filesystem component;
* fixes READMEs.

It's mergeable without any problems, but I would recommend to wait a fix in Composer in order to use `self.version` in `require`/`require-dev` sections.

Note: I kept `suggest` sections because it makes sense but this PR doesn't aim to provide useful explanations for each entry. It could be another PR, not that one.

---------------------------------------------------------------------------

by willdurand at 2012-04-30T20:43:13Z

@fabpot I reviewed each component, one by one. Now `phpunit` always works, even if tests are skipped. A simple `composer install --dev` allows to run the complete test suite. Each commit is well separated from the others. I guess, everything is ok now.

---------------------------------------------------------------------------

by Tobion at 2012-04-30T20:47:00Z

Please squash, as it makes no sense to have the same commit for each component.

---------------------------------------------------------------------------

by fabpot at 2012-05-01T14:26:11Z

Can you squash your commits before I merge? Thanks.

---------------------------------------------------------------------------

by willdurand at 2012-05-01T14:29:38Z

done

---------------------------------------------------------------------------

by fabpot at 2012-05-01T15:48:25Z

It does not seem that the commits are squashed.

---------------------------------------------------------------------------

by willdurand at 2012-05-01T15:54:08Z

done
  • Loading branch information...
2 parents 0b8b41c + fa1f0fd commit 0e6ee8d07dda6920106048247d41249201604e76 @fabpot fabpot committed May 1, 2012
Showing with 13 additions and 14 deletions.
  1. +2 −0 .gitignore
  2. +3 −4 README.md
  3. +4 −10 Tests/bootstrap.php
  4. +3 −0 composer.json
  5. +1 −0 phpunit.xml.dist
View
@@ -0,0 +1,2 @@
+vendor/
+composer.lock
View
@@ -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
View
@@ -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;
+}
View
@@ -18,6 +18,9 @@
"require": {
"php": ">=5.3.2"
},
+ "require-dev": {
+ "symfony/finder": "2.1.*"
+ },
"autoload": {
"psr-0": { "Symfony\\Component\\ClassLoader": "" }
},
View
@@ -23,6 +23,7 @@
<exclude>
<directory>./Resources</directory>
<directory>./Tests</directory>
+ <directory>./vendor</directory>
</exclude>
</whitelist>
</filter>

0 comments on commit 0e6ee8d

Please sign in to comment.