Skip to content

Commit

Permalink
Try eliminating redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
dshanske committed Nov 13, 2024
1 parent 32bf896 commit a5d5255
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/install-cp-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ CP_RELEASE=y
if [[ "$CP_VERSION" == latest ]]; then
# Find the version number of the latest release
download \
https://www.classicpress.net/latest.json \
https://www.classicpress.net/wp-json/cp/v1/latest \
"$TMPDIR/cp-latest.json"
CP_VERSION=$(grep -o '"version":"[^"]*' /tmp/cp-latest.json | sed 's/"version":"//')
CP_VERSION=$(grep -o '"version":"[^"]*' $TMPDIR/cp-latest.json | sed 's/"version":"//')

if [ -z "$CP_VERSION" ]; then
echo "ClassicPress version not detected correctly!"
Expand Down
7 changes: 7 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<?php

$_tests_dir = getenv( 'WP_TESTS_DIR' );
if ( ! $_tests_dir ) {
$_tests_dir = getenv( 'CP_TESTS_DIR' );
}
if ( ! $_tests_dir ) {
$_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';
}

if ( ! is_dir( $_tests_dir ) ) {
$_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/classicpress-tests-lib';
}

// Forward custom PHPUnit Polyfills configuration to PHPUnit bootstrap file.
$_phpunit_polyfills_path = getenv( 'WP_TESTS_PHPUNIT_POLYFILLS_PATH' );
if ( false !== $_phpunit_polyfills_path ) {
Expand Down

0 comments on commit a5d5255

Please sign in to comment.