- Timestamp:
- 03/19/2023 12:03:30 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php
r55457 r55562 136 136 } 137 137 138 public static function disposition_provider() { 138 /** 139 * @dataProvider data_parse_disposition 140 */ 141 public function test_parse_disposition( $header, $expected ) { 142 $header_list = array( $header ); 143 $parsed = WP_REST_Attachments_Controller::get_filename_from_disposition( $header_list ); 144 $this->assertSame( $expected, $parsed ); 145 } 146 147 public static function data_parse_disposition() { 139 148 return array( 140 149 // Types. … … 166 175 array( 'unknown; notfilename="foo.jpg"', null ), 167 176 ); 168 }169 170 /**171 * @dataProvider disposition_provider172 */173 public function test_parse_disposition( $header, $expected ) {174 $header_list = array( $header );175 $parsed = WP_REST_Attachments_Controller::get_filename_from_disposition( $header_list );176 $this->assertSame( $expected, $parsed );177 177 } 178 178 … … 1258 1258 } 1259 1259 1260 public static function attachment_roundtrip_provider() { 1260 /** 1261 * @dataProvider data_attachment_roundtrip_as_author 1262 * @requires function imagejpeg 1263 */ 1264 public function test_attachment_roundtrip_as_author( $raw, $expected ) { 1265 wp_set_current_user( self::$author_id ); 1266 $this->assertFalse( current_user_can( 'unfiltered_html' ) ); 1267 $this->verify_attachment_roundtrip( $raw, $expected ); 1268 } 1269 1270 public static function data_attachment_roundtrip_as_author() { 1261 1271 return array( 1262 1272 array( … … 1353 1363 ), 1354 1364 ); 1355 }1356 1357 /**1358 * @dataProvider attachment_roundtrip_provider1359 * @requires function imagejpeg1360 */1361 public function test_post_roundtrip_as_author( $raw, $expected ) {1362 wp_set_current_user( self::$author_id );1363 $this->assertFalse( current_user_can( 'unfiltered_html' ) );1364 $this->verify_attachment_roundtrip( $raw, $expected );1365 1365 } 1366 1366
Note: See TracChangeset
for help on using the changeset viewer.