@@ -26,8 +26,16 @@ if (PHP_VERSION_ID >= 70200) {
26
26
$ PHPUNIT_VERSION = '4.8 ' ;
27
27
}
28
28
29
+ if (file_exists (($ path = dirname (__DIR__ )).'/composer.json ' )) {
30
+ if (file_exists ($ path .'/vendor/symfony/phpunit-bridge/composer.json ' )) {
31
+ $ path .= '/vendor/symfony/phpunit-bridge ' ;
32
+ }
33
+ } elseif (file_exists ($ path .'/symfony/phpunit-bridge/composer.json ' )) {
34
+ $ path .= '/symfony/phpunit-bridge ' ;
35
+ }
36
+
29
37
$ oldPwd = getcwd ();
30
- $ PHPUNIT_DIR = getenv ('SYMFONY_PHPUNIT_DIR ' ) ?: (__DIR__ .'/.phpunit ' );
38
+ $ PHPUNIT_DIR = getenv ('SYMFONY_PHPUNIT_DIR ' ) ?: (dirname ( dirname ( __DIR__ ) === $ path ? $ path : __DIR__ ) .'/.phpunit ' );
31
39
$ PHP = defined ('PHP_BINARY ' ) ? PHP_BINARY : 'php ' ;
32
40
$ PHP = escapeshellarg ($ PHP );
33
41
if ('phpdbg ' === PHP_SAPI ) {
@@ -69,15 +77,8 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
69
77
passthru ("$ COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0 \"" );
70
78
}
71
79
passthru ("$ COMPOSER require --no-update symfony/phpunit-bridge \"* \"" );
72
- if (file_exists (($ path = dirname (__DIR__ )).'/composer.json ' )) {
73
- if (file_exists ($ path .'/vendor/symfony/phpunit-bridge/composer.json ' )) {
74
- $ path .= '/vendor/symfony/phpunit-bridge ' ;
75
- }
76
- } elseif (file_exists ($ path .'/symfony/phpunit-bridge/composer.json ' )) {
77
- $ path .= '/symfony/phpunit-bridge ' ;
78
- }
79
80
if (file_exists ($ path )) {
80
- passthru ("$ COMPOSER config repositories.phpunit-bridge path " .escapeshellarg ($ path ));
81
+ passthru ("$ COMPOSER config repositories.phpunit-bridge path " .escapeshellarg (str_replace ( ' / ' , DIRECTORY_SEPARATOR , $ path) ));
81
82
}
82
83
$ prevRoot = getenv ('COMPOSER_ROOT_VERSION ' );
83
84
putenv ("COMPOSER_ROOT_VERSION= $ PHPUNIT_VERSION .99 " );
0 commit comments