­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ # Travis CI Configuration file # @link https://travis-ci.org/ # Use new Travis container-based infrastructure # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ sudo: false # PHP # @link http://docs.travis-ci.com/user/languages/php/ language: php # Declare versions of PHP to test php: # aliased to a recent 7.1.x version - 7.1 # aliased to a recent 7.0.x version - 7.0 # aliased to a recent 5.6.x version - 5.6 # aliased to a recent 5.5.x version - 5.5 # aliased to a recent 5.4.x version - 5.4 # WordPress comes from the Git mirror, where 'master' mirrors svn 'trunk' and # x.y mirrors the latest from the x.y branch env: # WordPress 4.9 - WP_VERSION=4.9 # WordPress 4.8 - WP_VERSION=4.8 # WordPress 4.7 - WP_VERSION=4.7 matrix: fast_finish: true # before_install: Failures in this section will result in build status 'errored' before_install: # set up WP install - export WP_DEVELOP_DIR=/tmp/wordpress/ - mkdir -p $WP_DEVELOP_DIR - git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR - plugin_slug=$(basename $(pwd)) - plugin_dir=$WP_DEVELOP_DIR/src/wp-content/plugins/$plugin_slug - cd .. - mv $plugin_slug $plugin_dir # set up tests config - cd $WP_DEVELOP_DIR - echo $WP_DEVELOP_DIR - cp wp-tests-config-sample.php wp-tests-config.php - sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php - sed -i "s/yourusernamehere/travis/" wp-tests-config.php - sed -i "s/yourpasswordhere//" wp-tests-config.php # create database - mysql -e 'CREATE DATABASE wordpress_test;' -uroot # prepare for running the tests - cd $plugin_dir script: phpunit