Skip to content

Commit db0cf2f

Browse files
Tests: Temporarily disable REST index output-format assertions (#78788)
Core's re-introduced client-side media processing (changeset 62428) restored a pre-#75793 REST API root index that still exposes the file-less `image_output_formats`, `jpeg_interlaced`, `png_interlaced`, and `gif_interlaced` settings. When the plugin runs against Core trunk, these keys are present, so the `assertArrayNotHasKey` assertions in the media processing test fail. The proper fix lives in Core, where wordpress-develop#12007 removes these redundant index keys in favor of the per-attachment `image_output_format` and `image_save_progressive` response fields. Until that PR merges, disable the affected assertions and link to it so they can be reactivated. See WordPress/wordpress-develop#12007
1 parent 913ad1b commit db0cf2f

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

phpunit/media/media-processing-test.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,21 @@ public function test_get_rest_index_should_return_additional_settings_can_upload
136136
$data = $index->get_data();
137137

138138
$this->assertArrayHasKey( 'image_size_threshold', $data );
139-
$this->assertArrayNotHasKey( 'image_output_formats', $data );
140-
$this->assertArrayNotHasKey( 'jpeg_interlaced', $data );
141-
$this->assertArrayNotHasKey( 'png_interlaced', $data );
142-
$this->assertArrayNotHasKey( 'gif_interlaced', $data );
139+
/*
140+
* TODO: Reactivate these assertions once the Core PR below merges into trunk:
141+
* https://github.com/WordPress/wordpress-develop/pull/12007
142+
*
143+
* Core's re-introduced client-side media processing still exposes these
144+
* file-less output-format settings on the REST API root index. PR #12007
145+
* removes them in favor of the per-attachment `image_output_format` and
146+
* `image_save_progressive` response fields (completing the migration from
147+
* Gutenberg #75793). Until that lands in Core, these keys are present when
148+
* running against Core trunk, so the assertions are temporarily disabled.
149+
*/
150+
// $this->assertArrayNotHasKey( 'image_output_formats', $data );
151+
// $this->assertArrayNotHasKey( 'jpeg_interlaced', $data );
152+
// $this->assertArrayNotHasKey( 'png_interlaced', $data );
153+
// $this->assertArrayNotHasKey( 'gif_interlaced', $data );
143154
$this->assertArrayHasKey( 'image_sizes', $data );
144155
}
145156

0 commit comments

Comments
 (0)