Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/phpunit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ For more information, please review the relevant Core Handbook pages:
- [PHP: PHPUnit](https://make.wordpress.org/core/handbook/testing/automated-testing/phpunit/)
- [Writing PHP Tests](https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/)

## Run on a host that prohibits loopback listening

Set `WP_TESTS_SKIP_HTTP_LOOPBACK=1` in the PHPUnit process environment if the host prohibits listening on a local TCP port. When PHP cannot reserve a port, PHPUnit skips only the HTTP transport tests that need the local fixture server. If PHP reserves a port, the tests run normally and server startup errors still fail.

## Run the full matrix on a pull request

Add the `Full PHPUnit Matrix` label to a pull request in `WordPress/wordpress-develop` to run the same PHP and database combinations as the weekly scheduled run. The label-triggered workflow uses the same path filters as normal PHPUnit runs.
Expand Down
5 changes: 5 additions & 0 deletions tests/phpunit/tests/http/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ static function () {

if ( ! $socket ) {
self::remove_file_stream_fixture_dir( $fixture_dir );
if ( '1' === getenv( 'WP_TESTS_SKIP_HTTP_LOOPBACK' ) ) {
self::$file_stream_fixture_skip_reason = 'Loopback listening is restricted on this test host.';
return;
}

self::$file_stream_fixture_fail_reason = sprintf(
'Could not reserve a local TCP port for the HTTP stream fixture server (%d: %s).',
(int) $errno,
Expand Down
Loading