File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 3434 wp core download --version=" $WP_VERSION " --path=" $WP_CORE_DIR " --force
3535fi
3636
37+ # Capture the output of the wp-cli command in the variable "output" to extract the WP version
38+ output=$( wp core download --version=latest --path=" $WP_CORE_DIR " --force)
39+
40+ # Use grep to extract the version number
41+ LATEST_WP=$( echo " $output " | grep -oP ' Downloading WordPress \K[0-9]+\.[0-9]+\.[0-9]+' )
42+ echo " Latest WP version to use: $LATEST_WP "
43+
3744# Create a wp-config file for the test environment
3845cd " $WP_CORE_DIR "
3946wp config create --dbname=" $DB_NAME " --dbuser=" $DB_USER " --dbpass=" $DB_PASS " --dbhost=" $DB_HOST " --skip-check
@@ -48,8 +55,8 @@ wp core install --url=example.dev --title="Test Site" --admin_user=admin --admin
4855
4956# Download the testing framework
5057mkdir -p " $WP_TESTS_DIR "
51- svn checkout https://develop.svn.wordpress.org/trunk /tests/phpunit/includes/ " $WP_TESTS_DIR /includes"
52- svn export https://develop.svn.wordpress.org/trunk /wp-tests-config-sample.php " $WP_TESTS_DIR /includes/wp-tests-config-sample.php"
58+ svn checkout https://develop.svn.wordpress.org/tags/ $LATEST_WP /tests/phpunit/includes/ " $WP_TESTS_DIR /includes"
59+ svn export https://develop.svn.wordpress.org/tags/ $LATEST_WP /wp-tests-config-sample.php " $WP_TESTS_DIR /includes/wp-tests-config-sample.php"
5360
5461# Copy the wp-tests-config.php file template from the downloaded includes
5562cp " $WP_TESTS_DIR /includes/wp-tests-config-sample.php" " $WP_TESTS_DIR /wp-tests-config.php"
You can’t perform that action at this time.
0 commit comments