diff --git a/.travis.yml b/.travis.yml index 6aa217ee1..06ae36d0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,8 @@ cache: env: global: - - WP_CLI_BIN_DIR=/tmp/wp-cli-phar + - PATH="$TRAVIS_BUILD_DIR/vendor/bin:$PATH" + - WP_CLI_BIN_DIR="$TRAVIS_BUILD_DIR/vendor/bin" matrix: include: @@ -32,9 +33,15 @@ matrix: - php: 5.3 env: WP_VERSION=latest -before_script: +before_install: - phpenv config-rm xdebug.ini - - composer validate + +install: + - composer install - bash bin/install-package-tests.sh -script: ./vendor/bin/behat --format progress --strict +before_script: + - composer validate + +script: + - behat --format progress --strict diff --git a/bin/install-package-tests.sh b/bin/install-package-tests.sh index 3026f0826..2ff49dd8d 100755 --- a/bin/install-package-tests.sh +++ b/bin/install-package-tests.sh @@ -2,39 +2,9 @@ set -ex -WP_CLI_BIN_DIR=${WP_CLI_BIN_DIR-/tmp/wp-cli-phar} - -PACKAGE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ && pwd )" - -download() { - if [ `which curl` ]; then - curl -s "$1" > "$2"; - elif [ `which wget` ]; then - wget -nv -O "$2" "$1" - fi -} - -install_wp_cli() { - - # the Behat test suite will pick up the executable found in $WP_CLI_BIN_DIR - mkdir -p $WP_CLI_BIN_DIR - download https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar $WP_CLI_BIN_DIR/wp - chmod +x $WP_CLI_BIN_DIR/wp - -} - -download_behat() { - - cd $PACKAGE_DIR - composer require --dev behat/behat='~2.5' - -} - install_db() { mysql -e 'CREATE DATABASE IF NOT EXISTS wp_cli_test;' -uroot mysql -e 'GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"localhost" IDENTIFIED BY "password1"' -uroot } -install_wp_cli -download_behat install_db diff --git a/composer.json b/composer.json index 9979ad1b3..a86596afb 100644 --- a/composer.json +++ b/composer.json @@ -22,11 +22,16 @@ }, "files": [ "search-replace-command.php" ] }, - "require": {}, + "require": { + "wp-cli/wp-cli": "dev-master" + }, "require-dev": { "behat/behat": "~2.5" }, "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + }, "commands": [ "search-replace" ]