doc
1 year ago
lib
1 year ago
tests
1 year ago
.coveralls.yml
1 year ago
.git
1 year ago
.gitignore
1 year ago
.travis.yml
1 year ago
LICENSE.txt
1 year ago
README.md
1 year ago
build.php
1 year ago
composer.json
1 year ago
init.php
1 year ago
overview.md
1 year ago
phpunit.no_autoload.xml
1 year ago
phpunit.xml
1 year ago
release.php
1 year ago
test
1 year ago
build.php
35 lines
| 1 | #!/usr/bin/env php |
| 2 | <?php |
| 3 | chdir(__DIR__); |
| 4 | |
| 5 | $autoload = (int)$argv[1]; |
| 6 | $returnStatus = null; |
| 7 | |
| 8 | $composerOriginalRaw = file_get_contents('composer.json'); |
| 9 | if (!$autoload) { |
| 10 | // Modify composer to not autoload WonderPush |
| 11 | $composer = json_decode($composerOriginalRaw, true); |
| 12 | unset($composer['autoload']); |
| 13 | file_put_contents('composer.json', json_encode($composer)); |
| 14 | } |
| 15 | |
| 16 | passthru('composer install', $returnStatus); |
| 17 | if (!$autoload) { |
| 18 | // Revert rewrite |
| 19 | file_put_contents('composer.json', $composerOriginalRaw); |
| 20 | } |
| 21 | if ($returnStatus !== 0) { |
| 22 | exit(1); |
| 23 | } |
| 24 | |
| 25 | |
| 26 | $config = $autoload ? 'phpunit.xml' : 'phpunit.no_autoload.xml'; |
| 27 | passthru("./vendor/bin/phpunit -c $config", $returnStatus); |
| 28 | if (!$autoload) { |
| 29 | // Revert autoloader modifications made earlier |
| 30 | passthru('composer dump-autoload'); |
| 31 | } |
| 32 | if ($returnStatus !== 0) { |
| 33 | exit(1); |
| 34 | } |
| 35 |