Skip to content
Merged
5 changes: 1 addition & 4 deletions .github/files/generate-ci-matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@
'timeout' => 20, // 2022-01-25: 5.6 tests have started timing out at 15 minutes. Previously: Successful runs seem to take ~8 minutes for PHP 5.6 and for the 7.4 trunk run, ~5.5-6 for 7.x and 8.0.
);
}
// Uncomment this once WP trunk finally works with 8.1. Then merge into the above once WP latest does and we've cleaned up any problems in our own code.
// phpcs:ignore Squiz.PHP.CommentedOutCode.Found, Squiz.Commenting.BlockComment.NoEmptyLineBefore
/*
// Merge this into the above once we decide PHP 8.1 is stable and WP latest works with 8.1.
$matrix[] = array(
'name' => 'PHP tests: PHP 8.1 WP trunk',
'script' => 'test-php',
Expand All @@ -72,7 +70,6 @@
'timeout' => 15,
'experimental' => true,
);
*/
// Uncomment this once WP trunk finally works with 8.2. Then merge into the above once WP latest does and we've cleaned up any problems in our own code.
// phpcs:ignore Squiz.PHP.CommentedOutCode.Found, Squiz.Commenting.BlockComment.NoEmptyLineBefore
/*
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ jobs:
fi
fi

if [[ "$WP_BRANCH" == 'trunk' && ( "$TEST_SCRIPT" == "test-php" || "$TEST_SCRIPT" == "test-coverage" ) ]]; then
VER=$(composer --format=json --working-dir="$DIR" show | jq -r '.installed[] | select( .name == "roots/wordpress" ) | .version')
if [[ -n "$VER" ]]; then
echo 'Supposed to run tests against WordPress trunk, so upgrading roots/wordpress to dev-nightly'
composer --working-dir="$DIR" require --dev roots/wordpress="dev-nightly as $VER"
fi
fi

mkdir -p "artifacts/$SLUG"
export ARTIFACTS_DIR="$GITHUB_WORKSPACE/artifacts/$SLUG"
if [[ "$TEST_SCRIPT" == "test-coverage" ]]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: Set `REQUESTS_SILENCE_PSR0_DEPRECATIONS` when running tests for compat with WP trunk.


4 changes: 4 additions & 0 deletions projects/packages/connection/tests/php/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
*/
require_once __DIR__ . '/../../vendor/autoload.php';

// Disable warning about deprecated request library.
// @todo Remove this once we drop support for WordPress 6.1
define( 'REQUESTS_SILENCE_PSR0_DEPRECATIONS', true );

// Work around WordPress bug when `@runInSeparateProcess` is used.
if ( empty( $_SERVER['SCRIPT_FILENAME'] ) ) {
$_SERVER['SCRIPT_FILENAME'] = __DIR__ . '/vendor/phpunit/phpunit/phpunit';
Expand Down