Skip to content

Commit fa1234b

Browse files
committed
Updated PHPUnit version and binary file is simpler
1 parent 4813b1d commit fa1234b

3 files changed

Lines changed: 477 additions & 102 deletions

File tree

bin/phpunit-randomizer

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,20 @@
11
#!/usr/bin/env php
22
<?php
33

4-
function includeIfExists($file)
5-
{
4+
foreach (array(__DIR__ . '/../autoload.php', __DIR__ . '/../vendor/autoload.php') as $file) {
65
if (file_exists($file)) {
7-
return include $file;
6+
define('PHPUNIT_COMPOSER_INSTALL', $file);
7+
break;
88
}
99
}
10-
// Including composer autoload
11-
if (
12-
(!$loader = includeIfExists( __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'))
13-
&& (!$loader = includeIfExists( __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'autoload.php'))
14-
)
15-
{
16-
die(
17-
'You must set up the project dependencies, run the following commands:'.PHP_EOL.
18-
'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
19-
'php composer.phar install'.PHP_EOL
20-
);
21-
}
22-
// Including phpunit autoload
23-
if (
24-
(!file_exists( __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'phpunit' . DIRECTORY_SEPARATOR . 'phpunit' . DIRECTORY_SEPARATOR . 'PHPUnit' . DIRECTORY_SEPARATOR . 'Autoload.php'))
25-
&& (!file_exists( __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'phpunit' . DIRECTORY_SEPARATOR . 'phpunit' . DIRECTORY_SEPARATOR . 'PHPUnit' . DIRECTORY_SEPARATOR . 'Autoload.php'))
26-
)
27-
{
28-
die(
29-
'You must set up the project dependencies, run the following commands:'.PHP_EOL.
30-
'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
31-
'php composer.phar install'.PHP_EOL
32-
);
10+
11+
if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
12+
echo 'You need to set up the project dependencies using the following commands:' . PHP_EOL .
13+
'wget http://getcomposer.org/composer.phar' . PHP_EOL .
14+
'php composer.phar install' . PHP_EOL;
15+
die(1);
3316
}
3417

18+
require PHPUNIT_COMPOSER_INSTALL;
3519

3620
\PHPUnitRandomizer\Command::main();

composer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010
}
1111
],
1212
"require": {
13-
"phpunit/phpunit": "3.7.*@dev"
13+
"phpunit/phpunit": "4.2.*"
1414
},
1515
"bin": ["bin/phpunit-randomizer"],
16-
"minimum-stability": "dev",
1716
"autoload": {
1817
"psr-0": { "PHPUnitRandomizer": "src/" }
18+
},
19+
"extra": {
20+
"branch-alias": {
21+
"dev-master": "1.0.x-dev"
22+
}
1923
}
2024
}

0 commit comments

Comments
 (0)