diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..fb4ccfad --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +language: php + +php: + - 5.2 + - 5.3 + - 5.4 + - 5.5 + +env: + - WP_VERSION=master WP_MULTISITE=0 + - WP_VERSION=3.8.1 WP_MULTISITE=0 + - WP_VERSION=3.7.1 WP_MULTISITE=0 + - WP_VERSION=master WP_MULTISITE=1 + +before_script: + - export WP_TESTS_DIR=/tmp/wordpress-tests/ + - bash bin/install-wp-tests.sh wordpress_test root '' $WP_VERSION + +script: phpunit \ No newline at end of file diff --git a/bin/install-wp-tests.sh b/bin/install-wp-tests.sh new file mode 100644 index 00000000..7f8e7e7c --- /dev/null +++ b/bin/install-wp-tests.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +if [ $# -lt 3 ]; then + echo "usage: $0 [wp-version]" + exit 1 +fi + +DB_NAME=$1 +DB_USER=$2 +DB_PASS=$3 +WP_VERSION=${4-master} + +set -ex + +# set up a WP install +WP_CORE_DIR=/tmp/wordpress/ +mkdir -p $WP_CORE_DIR +wget -nv -O /tmp/wordpress.tar.gz https://github.com/WordPress/WordPress/tarball/$WP_VERSION +tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR + +# set up testing suite +svn co --ignore-externals https://unit-tests.svn.wordpress.org/trunk/ $WP_TESTS_DIR + +cd $WP_TESTS_DIR +cp wp-tests-config-sample.php wp-tests-config.php +sed -i "s:dirname( __FILE__ ) . '/wordpress/':'$WP_CORE_DIR':" wp-tests-config.php +sed -i "s/yourdbnamehere/$DB_NAME/" wp-tests-config.php +sed -i "s/yourusernamehere/$DB_USER/" wp-tests-config.php +sed -i "s/yourpasswordhere/$DB_PASS/" wp-tests-config.php + +# create database +mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS" \ No newline at end of file