Fix the pre-push hook error with different phpunit versions

Now the pre-push hook check first for a composer phpunit, it not found,
try to use a system wide one. If none of them are available, it will
rise an error
This commit is contained in:
Bruno F. Fontes 2021-02-11 18:29:32 -03:00
parent c88478f7d8
commit abda9e4ee8
Signed by: brunofontes
GPG Key ID: EE3447CE80048495

View File

@ -1,10 +1,10 @@
params="--bootstrap vendor/autoload.php tests --testdox --color" params="--bootstrap vendor/autoload.php tests --testdox --color"
if [ $(command -v phpunit) ]; then
phpunit $params
else
if [ -d ./vendor/phpunit ]; then if [ -d ./vendor/phpunit ]; then
./vendor/phpunit/phpunit/phpunit $params ./vendor/phpunit/phpunit/phpunit $params
else
if [ $(command -v phpunit) ]; then
phpunit $params
else else
echo "Please, run 'make install' or install phpunit globally to run the tests" echo "Please, run 'make install' or install phpunit globally to run the tests"
fi fi