machine:
  php:
    version: 5.6.22
  environment:
    WP_CLI_BIN_DIR: /tmp/wp-cli-phar

dependencies:
  cache_directories:
    - ~/.composer/cache
  pre:
    # Set the PHP timezone so that Behat does not fail.
    - echo "date.timezone = 'US/Central'" > /opt/circleci/php/$(phpenv global)/etc/conf.d/wp-cli-timezone.ini
    # Disable xdebug, which makes Composer slower.
    - echo ""  > /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini

test:
  pre:
    - composer validate
    - bash bin/install-package-tests.sh
  override:
    - WP_VERSION=latest ./vendor/bin/behat --strict
    - rm -rf '/tmp/wp-cli-test core-download-cache'
    - WP_VERSION=trunk ./vendor/bin/behat --strict
