-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
439372c
commit d4ecf9b
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,14 @@ set -e | |
|
||
DIRNAME=$(dirname "$0") | ||
|
||
download() { | ||
if [ "$(which curl)" ]; then | ||
curl -s "$1" > "$2"; | ||
elif [ "$(which wget)" ]; then | ||
wget -nv -O "$2" "$1" | ||
fi | ||
} | ||
|
||
echo "🤔 Installing WP Unit tests..." | ||
bash "${DIRNAME}/install-wp-tests.sh" wordpress_test root root 127.0.0.1 latest | ||
|
||
|
@@ -21,6 +29,16 @@ bash "${DIRNAME}/install-wp-tests.sh" wordpress_test root root 127.0.0.1 latest | |
echo "🏃♂️ Running PHPUnit on Multisite" | ||
composer test:multisite --ansi | ||
|
||
setup_wp_nightly() { | ||
download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json | ||
echo "Creating wp-config.php" | ||
wp config create --dbname=wordpress_test --dbuser=root --dbpass=root --dbhost=127.0.0.1 --dbprefix=wptests_ --path="${WP_CORE_DIR}" | ||
wp core install --url=localhost --title=Test --admin_user=admin --admin_password=password [email protected] --path="${WP_CORE_DIR}" | ||
# If nightly version of WP is installed, install latest Gutenberg plugin and activate it. | ||
echo "Installing Gutenberg plugin" | ||
wp plugin install gutenberg --activate --path="${WP_CORE_DIR}" | ||
} | ||
|
||
echo "🧹 Removing files before testing nightly WP..." | ||
rm -rf "$WP_TESTS_DIR" "$WP_CORE_DIR" | ||
rm "${DIRNAME}/../tests/wp-latest.json" | ||
|
@@ -29,5 +47,8 @@ echo "🤔 Installing WP Unit tests with WP nightly version..." | |
bash "${DIRNAME}/install-wp-tests.sh" wordpress_test root root 127.0.0.1 nightly true | ||
echo "📄 Copying wp-latest.json..." | ||
cp /tmp/wp-latest.json "${DIRNAME}/../tests/wp-latest.json" | ||
|
||
setup_wp_nightly | ||
|
||
echo "🏃♂️ Running PHPUnit on Single Site (Nightly WordPress)" | ||
composer phpunit --ansi |