diff --git a/packages/playground/remote/src/lib/playground-mu-plugin/0-playground.php b/packages/playground/remote/src/lib/playground-mu-plugin/0-playground.php index 269afebfab..7df5907c0f 100644 --- a/packages/playground/remote/src/lib/playground-mu-plugin/0-playground.php +++ b/packages/playground/remote/src/lib/playground-mu-plugin/0-playground.php @@ -99,7 +99,7 @@ function networking_disabled() { * This mu-plugin provides that transport. It's one of the two: * * * WP_Http_Fetch – Sends requests using browser's fetch() function. - * * Requests_Transport_Dummy – Does not send any requests and only exists to keep + * * WP_Http_Dummy – Does not send any requests and only exists to keep * the Requests class happy. */ $__requests_class = class_exists( '\WpOrg\Requests\Requests' ) ? '\WpOrg\Requests\Requests' : 'Requests'; @@ -107,12 +107,20 @@ function networking_disabled() { require(__DIR__ . '/playground-includes/wp_http_fetch.php'); /** * Force the Fetch transport to be used in Requests. - * The 'http_api_transports' filter was deprecated, and is no longer actively in use. */ add_action( 'requests-requests.before_request', function( $url, $headers, $data, $type, &$options ) { $options['transport'] = 'Wp_Http_Fetch'; }, 10, 5 ); + /** + * Force wp_http_supports() to work, which uses deprecated WP_HTTP methods. + * This filter is deprecated, and no longer actively used, but is needed for wp_http_supports(). + * @see https://core.trac.wordpress.org/ticket/37708 + */ + add_filter('http_api_transports', function() { + return [ 'Fetch' ]; + }); + /** * Disable signature verification as it doesn't seem to work with * fetch requests: @@ -137,6 +145,10 @@ function networking_disabled() { add_action( 'requests-requests.before_request', function( $url, $headers, $data, $type, &$options ) { $options['transport'] = 'Wp_Http_Dummy'; }, 10, 5 ); + + add_filter('http_api_transports', function() { + return [ 'Dummy' ]; + }); } ?> diff --git a/packages/playground/website/cypress/e2e/query-api.cy.ts b/packages/playground/website/cypress/e2e/query-api.cy.ts index e670d67cc8..01ed31f31e 100644 --- a/packages/playground/website/cypress/e2e/query-api.cy.ts +++ b/packages/playground/website/cypress/e2e/query-api.cy.ts @@ -85,9 +85,12 @@ describe('Query API', () => { /** * @see https://github.com/WordPress/wordpress-playground/pull/1045 + * @see https://github.com/WordPress/wordpress-playground/pull/1504 */ - it('should enable networking when requested AND the kitchen sink extension bundle is enabled', () => { - cy.visit('/?networking=yes&url=/wp-admin/plugin-install.php'); + it('should enable networking when requested AND the kitchen sink extension bundle is NOT enabled', () => { + cy.visit( + '/?networking=yes&php-extension-bundle=light&url=/wp-admin/plugin-install.php' + ); cy.wordPressDocument() .find('.plugin-card') .should('have.length.above', 4); @@ -104,6 +107,7 @@ describe('Query API', () => { features: { networking: true, }, + phpExtensionBundles: ['light'], steps: [ { step: 'writeFile',