16
16
error_reporting (-1 );
17
17
18
18
// PHPUnit 4.8 does not support PHP 7, while 5.1 requires PHP 5.6+
19
- $ PHPUNIT_VERSION = PHP_VERSION_ID >= 50600 ? '5.1 ' : '4.8 ' ;
19
+ $ PHPUNIT_VERSION = PHP_VERSION_ID >= 50600 ? getenv ( ' SYMFONY_PHPUNIT_VERSION ' ) ?: '5.1 ' : '4.8 ' ;
20
20
$ oldPwd = getcwd ();
21
21
$ PHPUNIT_DIR = getenv ('SYMFONY_PHPUNIT_DIR ' ) ?: (__DIR__ .'/.phpunit ' );
22
22
$ PHP = defined ('PHP_BINARY ' ) ? PHP_BINARY : 'php ' ;
@@ -29,8 +29,8 @@ $COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar') || ($COMPOSER = rt
29
29
? $ PHP .' ' .escapeshellarg ($ COMPOSER )
30
30
: 'composer ' ;
31
31
32
- if (!file_exists ("$ PHPUNIT_DIR /phpunit- $ PHPUNIT_VERSION /phpunit " ) || md5_file (__FILE__ ) !== @file_get_contents ("$ PHPUNIT_DIR /. $ PHPUNIT_VERSION .md5 " )) {
33
- // Build a standalone phpunit without symfony/yaml nor prophecy
32
+ if (!file_exists ("$ PHPUNIT_DIR /phpunit- $ PHPUNIT_VERSION /phpunit " ) || md5_file (__FILE__ ). "\n" . getenv ( ' SYMFONY_PHPUNIT_REMOVE ' ) !== @file_get_contents ("$ PHPUNIT_DIR /. $ PHPUNIT_VERSION .md5 " )) {
33
+ // Build a standalone phpunit without symfony/yaml nor prophecy by default
34
34
35
35
@mkdir ($ PHPUNIT_DIR );
36
36
chdir ($ PHPUNIT_DIR );
@@ -48,8 +48,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
48
48
$ zip ->extractTo (getcwd ());
49
49
$ zip ->close ();
50
50
chdir ("phpunit- $ PHPUNIT_VERSION " );
51
- passthru ("$ COMPOSER remove --no-update phpspec/prophecy " );
52
- passthru ("$ COMPOSER remove --no-update symfony/yaml " );
51
+ passthru ("$ COMPOSER remove --no-update " .(getenv ('SYMFONY_PHPUNIT_REMOVE ' ) ?: 'phpspec/prophecy symfony/yaml ' ));
53
52
if (5.1 <= $ PHPUNIT_VERSION && $ PHPUNIT_VERSION < 5.4 ) {
54
53
passthru ("$ COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0 \"" );
55
54
}
@@ -68,7 +67,7 @@ Symfony\Bridge\PhpUnit\TextUI\Command::main();
68
67
EOPHP
69
68
);
70
69
chdir ('.. ' );
71
- file_put_contents (". $ PHPUNIT_VERSION .md5 " , md5_file (__FILE__ ));
70
+ file_put_contents (". $ PHPUNIT_VERSION .md5 " , md5_file (__FILE__ ). "\n" . getenv ( ' SYMFONY_PHPUNIT_REMOVE ' ) );
72
71
chdir ($ oldPwd );
73
72
74
73
}
0 commit comments