Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 2cebdd6803abf9c7240bb2a7a5c3aa8f45a9ef9f 2 parents b0a5450 + 5a4ea52
@fabpot fabpot authored
View
2  .gitignore
@@ -0,0 +1,2 @@
+vendor/
+composer.lock
View
8 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
View
16 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;
+}
View
6 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"
View
1  phpunit.xml.dist
@@ -23,6 +23,7 @@
<exclude>
<directory>./Resources</directory>
<directory>./Tests</directory>
+ <directory>./vendor</directory>
</exclude>
</whitelist>
</filter>
Please sign in to comment.
Something went wrong with that request. Please try again.