Skip to content

Commit f4b1275

Browse files
committed
Modernize install-wp-tests.sh script
1 parent fa81018 commit f4b1275

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

bin/install-wp-tests.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ SKIP_DB_CREATE=${6-false}
1717
TMPDIR=${TMPDIR-/tmp}
1818
TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//")
1919
WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib}
20+
WP_TESTS_FILE="$WP_TESTS_DIR"/includes/functions.php
2021
WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress/}
22+
WP_CORE_FILE="$WP_CORE_DIR"/wp-includs.php
2123

2224
download() {
2325
if [ `which curl` ]; then
@@ -59,10 +61,11 @@ set -ex
5961

6062
install_wp() {
6163

62-
if [ -d $WP_CORE_DIR ]; then
64+
if [ -f $WP_CORE_FILE ]; then
6365
return;
6466
fi
6567

68+
rm -rf $WP_CORE_DIR
6669
mkdir -p $WP_CORE_DIR
6770

6871
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
@@ -106,9 +109,10 @@ install_test_suite() {
106109
local ioption='-i'
107110
fi
108111

109-
# set up testing suite if it doesn't yet exist
110-
if [ ! -d $WP_TESTS_DIR ]; then
112+
# set up testing suite if it doesn't yet exist or only partially exists
113+
if [ ! -f $WP_TESTS_FILE ]; then
111114
# set up testing suite
115+
rm -rf $WP_TESTS_DIR
112116
mkdir -p $WP_TESTS_DIR
113117
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
114118
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data

0 commit comments

Comments
 (0)