diff --git a/composer.json b/composer.json index 6272975..d397cb4 100644 --- a/composer.json +++ b/composer.json @@ -25,8 +25,8 @@ "phpmetrics:violations": "./vendor/bin/phpmetrics --violations-xml=phpmetrics/violations.xml phpcs-custom-sniffs", "psalm": "./vendor/bin/psalm --threads=1 --no-cache", "phpstan": "./vendor/bin/phpstan analyse --memory-limit=1G", - "test:unit": "./vendor/bin/phpunit --colors=always || echo 'No PHP test suite in this repo (no phpunit.xml, no tests/) - skipping...'", - "test:all": "./vendor/bin/phpunit --colors=always || echo 'No PHP test suite in this repo (no phpunit.xml, no tests/) - skipping...'", + "test:unit": "if [ -f phpunit.xml ] || [ -f phpunit.xml.dist ]; then ./vendor/bin/phpunit --colors=always; else echo 'SKIPPED: no phpunit.xml in this repo - there is no PHP test suite to run'; fi", + "test:all": "if [ -f phpunit.xml ] || [ -f phpunit.xml.dist ]; then ./vendor/bin/phpunit --colors=always; else echo 'SKIPPED: no phpunit.xml in this repo - there is no PHP test suite to run'; fi", "check": "E=0; for CMD in lint phpcs psalm test:unit; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E", "check:full": "E=0; for CMD in lint phpcs psalm phpstan test:all; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E", "check:strict": "E=0; for CMD in lint phpcs phpmd psalm phpstan test:all; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E",