diff --git a/.travis.yml b/.travis.yml index 6730b3d7db6..809086ff8f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ language: php dist: trusty sudo: required - +cache: + directories: + - vendor + - $HOME/.composer/cache matrix: include: - name: "PHP 7.2 unit tests, PHP Coding standards check" @@ -17,6 +20,5 @@ before_script: script: - composer install - - export PATH="$WP_CORE_DIR/wp-content/plugins/woocommerce-rest-api/vendor/bin:$PATH" - bash unit-tests/bin/phpunit.sh - bash unit-tests/bin/phpcs.sh \ No newline at end of file diff --git a/unit-tests/bin/phpunit.sh b/unit-tests/bin/phpunit.sh index be8fe8761b5..5e3d054f19c 100755 --- a/unit-tests/bin/phpunit.sh +++ b/unit-tests/bin/phpunit.sh @@ -1,9 +1,8 @@ #!/usr/bin/env bash WORKING_DIR="$PWD" -cd "$WP_CORE_DIR/wp-content/plugins/woocommerce-rest-api/" -which phpunit -phpunit --version -phpunit -c phpunit.xml +cd "$WP_CORE_DIR/wp-content/plugins/woocommerce-rest-api" +./vendor/bin/phpunit --version +./vendor/bin/phpunit -c phpunit.xml TEST_RESULT=$? cd "$WORKING_DIR" exit $TEST_RESULT \ No newline at end of file