diff --git a/tests/script.sh b/tests/script.sh index d7c4eba..c943ad1 100755 --- a/tests/script.sh +++ b/tests/script.sh @@ -8,7 +8,7 @@ fi # Run tests. phpunit --version -phpunit --configuration tests/phpunit.xml +phpunit --configuration "tests/phpunit.xml" if [[ "${?}" -ne 0 ]]; then ((errors++)) fi @@ -112,4 +112,20 @@ if [[ ! -z "${elses}" ]]; then ((errors++)) fi +# Add composer bin directory to the path environment variable. +export PATH="$PWD/vendor/bin:$PATH" + +# Detect coding standard violations. +phpcs --version +phpcs \ + --extensions="php" \ + --ignore="*/vendor/*" \ + --standard="tests/ruleset.xml" \ + -p \ + -s \ + . +if [[ "${?}" -ne 0 ]]; then + ((errors++)) +fi + exit "${errors}"