10 - PATH=$PATH:/home/travis/.composer/vendor/bin
11 - TRAVIS_NODE_VERSION="4.0.0"
28 # Enable Travis containers.
32 - composer self-update
33 # Use the example composer.json file for Drupal 8, and also install the behat drush endpoint.
34 - test ${DRUPAL_VERSION} -ne 8 || (cp doc/_static/composer.json.d8 ./composer.json && composer require --prefer-source drush-ops/behat-drush-endpoint drupal/drupal-driver:dev-master)
37 - composer global require drush/drush:~8.0
38 # Install the Behat Drush Endpoint for Drupal 7 tests.
39 - test ${DRUPAL_VERSION} -ne 7 || (git clone https://github.com/drush-ops/behat-drush-endpoint.git drush/behat-drush-endpoint && (cd drush/behat-drush-endpoint && composer install))
41 # @see http://austinpray.com/ops/2015/09/20/change-travis-node-version.html
42 - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
46 # Set NODE_PATH for zombie driver.
47 - export NODE_PATH="`pwd`/node_modules"
48 # Define the module path according to the Drupal version being tested.
49 - test ${DRUPAL_VERSION} -eq 8 && export MODULE_PATH='drupal/modules' || export MODULE_PATH='drupal/sites/all/modules'
50 # Drupal 8 uses semantic versioning.
51 - test ${DRUPAL_VERSION} -eq 8 && export PROJECT_NAME='drupal-8.1.x' || export PROJECT_NAME="drupal-${DRUPAL_VERSION}.x"
52 # Set sendmail so drush doesn't throw an error during site install.
53 - echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
54 # Download and install Drupal so we can test API abilities.
55 - mysql -e 'create database drupal'
56 - drush --quiet dl ${PROJECT_NAME} --all --drupal-project-rename=drupal
57 - drush --yes --root=$PWD/drupal site-install --db-url=mysql://travis:@127.0.0.1/drupal
58 # Copy the static HTML that is used for blackbox testing in the web root.
59 - cp -r fixtures/blackbox $PWD/drupal
60 # Copy our test module to the correct location.
61 - cp -r fixtures/drupal${DRUPAL_VERSION}/modules/behat_test ${MODULE_PATH}
63 - drush --yes en behat_test
65 - test ${DRUPAL_VERSION} -eq 6 || drush help behat
66 # Only revert features on Drupal 7.
67 - test \! ${DRUPAL_VERSION} -eq 7 || drush --yes fr behat_test
68 # Disable the page cache on Drupal 8.
69 - test \! ${DRUPAL_VERSION} -eq 8 || drush --yes pmu page_cache
70 # Test with big_pipe enabled for Drupal 8.
71 - test \! ${DRUPAL_VERSION} -eq 8 || drush --yes en -y big_pipe
72 # Clear the cache on Drupal 6 and 7, rebuild on Drupal 8.
73 - test ${DRUPAL_VERSION} -eq 8 && drush cr || drush cc all || true
74 - drush --debug runserver :8888 > ~/debug.txt 2>&1 &
79 - find ./src -name "*.php" -print0 | xargs -0 -n1 -P8 php -l
80 - vendor/bin/phpspec run -f pretty --no-interaction
81 - vendor/bin/behat -fprogress --strict
82 - vendor/bin/behat -fprogress --profile=drupal${DRUPAL_VERSION} --strict
83 # Do not test the Drush profile unless Drupal 7 was installed.
84 - test ${DRUPAL_VERSION} -ne 7 || vendor/bin/behat -fprogress --profile=drush --strict