diff --git a/.gitignore b/.gitignore index 75963ed9..0e9a72b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ parallelunit.sublime-workspace parallelunit.sublime-project -: chromedriver.log vendor composer.lock @@ -11,3 +10,4 @@ nbproject .php_cs .php_cs.cache .phpunit.result.cache +bin/paratest.phar diff --git a/.travis.yml b/.travis.yml index 4ae202e2..8fa0c5d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ install: - if [[ $CS_CHECK == 'true' ]]; then phpenv config-rm xdebug.ini || return 0; else composer remove --dev --no-update --no-scripts friendsofphp/php-cs-fixer; fi; - if [[ $PHPUNIT_DEV == 'true' ]]; then composer require --no-update phpunit/phpunit=*@dev; fi; - if [[ $DEPS == 'lowest' ]]; then COMPOSER_ARGS='--prefer-lowest --prefer-stable'; fi; composer update --no-interaction --prefer-dist $COMPOSER_ARGS + - if [[ $BUILD_PHAR == 'true' ]]; then wget https://github.com/humbug/box/releases/download/3.7.0/box.phar fi; script: - if [[ $CS_CHECK == 'true' ]]; then vendor/bin/php-cs-fixer fix --diff --dry-run --verbose; fi; @@ -40,7 +41,7 @@ after_script: - if [[ $CODE_COVERAGE == 'true' ]]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi; before_deploy: - - if [[ $BUILD_PHAR == 'true' ]]; then mkdir -p build; (cd build; curl -LSs https://box-project.github.io/box2/installer.php | php; php -d phar.readonly=0 box.phar build -c ../box.json.dist;); fi; + - if [[ $BUILD_PHAR == 'true' ]]; then php box.phar compile fi; deploy: provider: releases diff --git a/bin/paratest b/bin/paratest index 226e53dd..6cfd5505 100755 --- a/bin/paratest +++ b/bin/paratest @@ -25,6 +25,12 @@ if (!$found) { ); } +if (false === in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) { + echo PHP_EOL . 'ParaTest may only be invoked from a command line, got "' . PHP_SAPI . '"' . PHP_EOL; + + exit(1); +} + #use ParaTest\UI\Text\PHPUnitTextUI; #PHPUnitTextUI::main(); diff --git a/box.json.dist b/box.json.dist index 99734d01..7a687371 100644 --- a/box.json.dist +++ b/box.json.dist @@ -1,9 +1,7 @@ { - "alias": "paratest.phar", - "chmod": "0755", "compactors": [ - "Herrera\\Box\\Compactor\\Json", - "Herrera\\Box\\Compactor\\Php" + "KevinGH\\Box\\Compactor\\Json", + "KevinGH\\Box\\Compactor\\Php" ], "directories": [ "src" @@ -20,8 +18,5 @@ "files": [ "LICENSE" ], - "git-version": "git-version", - "main": "bin/paratest", - "output": "paratest-@git-version@.phar", - "stub": true + "git-version": "git-version" }