Skip to content

Commit

Permalink
Update install-wp-tests.sh and .travix.yml
Browse files Browse the repository at this point in the history
The old version of the install-wp-tests.sh script would only install
the latest stable version. This update uses the latest template from
WP-CLI, which includes support for testing against trunk.
  • Loading branch information
joemcgill authored and jaspermdegroot committed Nov 4, 2015
1 parent d10aad1 commit 994b876
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -9,8 +9,8 @@ php:
- 7.0

env:
- WP_VERSION=latest WP_MULTISITE=0
- WP_VERSION=latest WP_MULTISITE=1
- WP_VERSION=trunk WP_MULTISITE=0
- WP_VERSION=trunk WP_MULTISITE=1
- WP_VERSION=4.3 WP_MULTISITE=0
- WP_VERSION=4.3 WP_MULTISITE=1
- WP_VERSION=4.2 WP_MULTISITE=0
Expand Down
20 changes: 14 additions & 6 deletions bin/install-wp-tests.sh
Expand Up @@ -24,6 +24,8 @@ download() {

if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then
WP_TESTS_TAG="tags/$WP_VERSION"
elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
WP_TESTS_TAG="trunk"
else
# http serves a single offer, whereas https serves multiple. we only want one
download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json
Expand All @@ -46,15 +48,21 @@ install_wp() {

mkdir -p $WP_CORE_DIR

if [ $WP_VERSION == 'latest' ]; then
local ARCHIVE_NAME='latest'
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
mkdir -p /tmp/wordpress-nightly
download https://wordpress.org/nightly-builds/wordpress-latest.zip /tmp/wordpress-nightly/wordpress-nightly.zip
unzip -q /tmp/wordpress-nightly/wordpress-nightly.zip -d /tmp/wordpress-nightly/
mv /tmp/wordpress-nightly/wordpress/* $WP_CORE_DIR
else
local ARCHIVE_NAME="wordpress-$WP_VERSION"
if [ $WP_VERSION == 'latest' ]; then
local ARCHIVE_NAME='latest'
else
local ARCHIVE_NAME="wordpress-$WP_VERSION"
fi
download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz
tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR
fi

download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz
tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR

download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php
}

Expand Down

0 comments on commit 994b876

Please sign in to comment.