From 652e622aa84c312d439783b4085835b9ba44c0a6 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 11 Jun 2019 11:37:09 +0100 Subject: [PATCH] Config --- .travis.yml | 3 ++- composer.json | 3 ++- unit-tests/bin/phpcs.sh | 2 +- unit-tests/bin/phpunit.sh | 3 +-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 809086ff8f2..04246378dee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,9 +16,10 @@ matrix: before_script: - phpenv config-rm xdebug.ini + - composer install + - export PATH="$HOME/.composer/vendor/bin:$PATH" - bash unit-tests/bin/install.sh woocommerce_test root '' localhost $WP_VERSION script: - - composer install - bash unit-tests/bin/phpunit.sh - bash unit-tests/bin/phpcs.sh \ No newline at end of file diff --git a/composer.json b/composer.json index 8eef292cb10..3185cd520c3 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,8 @@ "composer/installers" : "~1.0" }, "require-dev": { - "phpunit/phpunit": "6.5.14" + "phpunit/phpunit": "6.5.14", + "woocommerce/woocommerce-sniffs": "0.0.6" }, "autoload": { "classmap": ["src"] diff --git a/unit-tests/bin/phpcs.sh b/unit-tests/bin/phpcs.sh index b66495f557e..5a2c8b48a05 100755 --- a/unit-tests/bin/phpcs.sh +++ b/unit-tests/bin/phpcs.sh @@ -6,6 +6,6 @@ if [[ ${RUN_PHPCS} == 1 ]]; then if [ "$CHANGED_FILES" != "" ]; then echo "Running Code Sniffer." - phpcs --ignore=$IGNORE --encoding=utf-8 -s -n -p $CHANGED_FILES + ./vendor/bin/phpcs --ignore=$IGNORE --encoding=utf-8 -s -n -p $CHANGED_FILES fi fi diff --git a/unit-tests/bin/phpunit.sh b/unit-tests/bin/phpunit.sh index 773d188c61a..12e95676881 100755 --- a/unit-tests/bin/phpunit.sh +++ b/unit-tests/bin/phpunit.sh @@ -1,3 +1,2 @@ #!/usr/bin/env bash -"$TRAVIS_BUILD_DIR"/vendor/bin/phpunit --version -"$TRAVIS_BUILD_DIR"/vendor/bin/phpunit -c phpunit.xml $@ \ No newline at end of file +$HOME/.composer/vendor/bin/phpunit -c phpunit.xml $@ \ No newline at end of file