Skip to content

Commit 9bcbfe6

Browse files
committed
Tests: Fix REST schema and multisite test failures
Restore the `wp_client_side_media_processing_enabled` filter and the `finalize` route that were accidentally removed from the REST schema test. Add the `collaboration` table to the list of tables expected to be empty after multisite site creation.
1 parent 6827989 commit 9bcbfe6

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

tests/phpunit/tests/multisite/site.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function test_created_site_details() {
179179
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
180180
$result = $wpdb->get_results( "SELECT * FROM $prefix$table LIMIT 1" );
181181

182-
if ( 'commentmeta' === $table || 'termmeta' === $table || 'links' === $table ) {
182+
if ( 'commentmeta' === $table || 'termmeta' === $table || 'links' === $table || 'collaboration' === $table ) {
183183
$this->assertEmpty( $result );
184184
} else {
185185
$this->assertNotEmpty( $result );

tests/phpunit/tests/rest-api/rest-schema-setup.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
1616
public function set_up() {
1717
parent::set_up();
1818

19+
// Ensure client-side media processing is enabled so the sideload route is registered.
20+
add_filter( 'wp_client_side_media_processing_enabled', '__return_true' );
21+
1922
// Ensure collaboration routes are registered.
2023
add_filter( 'pre_option_wp_enable_real_time_collaboration', '__return_true' );
2124

@@ -113,6 +116,7 @@ public function test_expected_routes_in_schema() {
113116
'/wp/v2/media/(?P<id>[\\d]+)/post-process',
114117
'/wp/v2/media/(?P<id>[\\d]+)/edit',
115118
'/wp/v2/media/(?P<id>[\\d]+)/sideload',
119+
'/wp/v2/media/(?P<id>[\\d]+)/finalize',
116120
'/wp/v2/blocks',
117121
'/wp/v2/blocks/(?P<id>[\d]+)',
118122
'/wp/v2/blocks/(?P<id>[\d]+)/autosaves',

0 commit comments

Comments
 (0)