Changeset 44785 for trunk/tests/phpunit/tests/post/attachments.php
- Timestamp:
- 03/01/2019 08:57:26 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/attachments.php
r42343 r44785 28 28 $contents = file_get_contents( $filename ); 29 29 30 $upload = wp_upload_bits( basename( $filename ), null, $contents );30 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 31 31 $this->assertTrue( empty( $upload['error'] ) ); 32 32 … … 40 40 // medium, medium_large, and full size will both point to the original 41 41 $downsize = image_downsize( $id, 'medium' ); 42 $this->assertEquals( basename( $upload['file'] ),basename( $downsize[0] ) );42 $this->assertEquals( wp_basename( $upload['file'] ), wp_basename( $downsize[0] ) ); 43 43 $this->assertEquals( 50, $downsize[1] ); 44 44 $this->assertEquals( 50, $downsize[2] ); 45 45 46 46 $downsize = image_downsize( $id, 'medium_large' ); 47 $this->assertEquals( basename( $upload['file'] ),basename( $downsize[0] ) );47 $this->assertEquals( wp_basename( $upload['file'] ), wp_basename( $downsize[0] ) ); 48 48 $this->assertEquals( 50, $downsize[1] ); 49 49 $this->assertEquals( 50, $downsize[2] ); 50 50 51 51 $downsize = image_downsize( $id, 'full' ); 52 $this->assertEquals( basename( $upload['file'] ),basename( $downsize[0] ) );52 $this->assertEquals( wp_basename( $upload['file'] ), wp_basename( $downsize[0] ) ); 53 53 $this->assertEquals( 50, $downsize[1] ); 54 54 $this->assertEquals( 50, $downsize[2] ); … … 67 67 $contents = file_get_contents( $filename ); 68 68 69 $upload = wp_upload_bits( basename( $filename ), null, $contents );69 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 70 70 $this->assertTrue( empty( $upload['error'] ) ); 71 71 … … 87 87 // image_downsize() should return the correct images and sizes 88 88 $downsize = image_downsize( $id, 'thumbnail' ); 89 $this->assertEquals( 'a2-small-150x150.jpg', basename( $downsize[0] ) );89 $this->assertEquals( 'a2-small-150x150.jpg', wp_basename( $downsize[0] ) ); 90 90 $this->assertEquals( 150, $downsize[1] ); 91 91 $this->assertEquals( 150, $downsize[2] ); … … 93 93 // medium, medium_large, and full will both point to the original 94 94 $downsize = image_downsize( $id, 'medium' ); 95 $this->assertEquals( 'a2-small.jpg', basename( $downsize[0] ) );95 $this->assertEquals( 'a2-small.jpg', wp_basename( $downsize[0] ) ); 96 96 $this->assertEquals( 400, $downsize[1] ); 97 97 $this->assertEquals( 300, $downsize[2] ); 98 98 99 99 $downsize = image_downsize( $id, 'medium_large' ); 100 $this->assertEquals( 'a2-small.jpg', basename( $downsize[0] ) );100 $this->assertEquals( 'a2-small.jpg', wp_basename( $downsize[0] ) ); 101 101 $this->assertEquals( 400, $downsize[1] ); 102 102 $this->assertEquals( 300, $downsize[2] ); 103 103 104 104 $downsize = image_downsize( $id, 'full' ); 105 $this->assertEquals( 'a2-small.jpg', basename( $downsize[0] ) );105 $this->assertEquals( 'a2-small.jpg', wp_basename( $downsize[0] ) ); 106 106 $this->assertEquals( 400, $downsize[1] ); 107 107 $this->assertEquals( 300, $downsize[2] ); … … 123 123 $contents = file_get_contents( $filename ); 124 124 125 $upload = wp_upload_bits( basename( $filename ), null, $contents );125 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 126 126 $this->assertTrue( empty( $upload['error'] ) ); 127 127 … … 147 147 // image_downsize() should return the correct images and sizes 148 148 $downsize = image_downsize( $id, 'thumbnail' ); 149 $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', basename( $downsize[0] ) );149 $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', wp_basename( $downsize[0] ) ); 150 150 $this->assertEquals( 150, $downsize[1] ); 151 151 $this->assertEquals( 150, $downsize[2] ); 152 152 153 153 $downsize = image_downsize( $id, 'medium' ); 154 $this->assertEquals( '2007-06-17DSC_4173-400x602.jpg', basename( $downsize[0] ) );154 $this->assertEquals( '2007-06-17DSC_4173-400x602.jpg', wp_basename( $downsize[0] ) ); 155 155 $this->assertEquals( 400, $downsize[1] ); 156 156 $this->assertEquals( 602, $downsize[2] ); 157 157 158 158 $downsize = image_downsize( $id, 'medium_large' ); 159 $this->assertEquals( '2007-06-17DSC_4173-600x904.jpg', basename( $downsize[0] ) );159 $this->assertEquals( '2007-06-17DSC_4173-600x904.jpg', wp_basename( $downsize[0] ) ); 160 160 $this->assertEquals( 600, $downsize[1] ); 161 161 $this->assertEquals( 904, $downsize[2] ); 162 162 163 163 $downsize = image_downsize( $id, 'full' ); 164 $this->assertEquals( '2007-06-17DSC_4173.jpg', basename( $downsize[0] ) );164 $this->assertEquals( '2007-06-17DSC_4173.jpg', wp_basename( $downsize[0] ) ); 165 165 $this->assertEquals( 680, $downsize[1] ); 166 166 $this->assertEquals( 1024, $downsize[2] ); … … 182 182 $contents = file_get_contents( $filename ); 183 183 184 $upload = wp_upload_bits( basename( $filename ), null, $contents );184 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 185 185 $this->assertTrue( empty( $upload['error'] ) ); 186 186 … … 225 225 $contents = file_get_contents( $filename ); 226 226 227 $upload = wp_upload_bits( basename( $filename ), null, $contents );227 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 228 228 $this->assertTrue( empty( $upload['error'] ) ); 229 229 … … 242 242 $contents = file_get_contents( $filename ); 243 243 244 $upload = wp_upload_bits( basename( $filename ), null, $contents );244 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 245 245 $this->assertTrue( empty( $upload['error'] ) ); 246 246 … … 268 268 $contents = file_get_contents( $filename ); 269 269 270 $upload = wp_upload_bits( basename( $filename ), null, $contents );270 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 271 271 $this->assertTrue( empty( $upload['error'] ) ); 272 272 … … 300 300 $contents = file_get_contents( $filename ); 301 301 302 $upload = wp_upload_bits( basename( $filename ), null, $contents );302 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 303 303 $this->assertTrue( empty( $upload['error'] ) ); 304 304 … … 325 325 $contents = file_get_contents( $filename ); 326 326 327 $upload = wp_upload_bits( basename( $filename ), null, $contents );327 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 328 328 $this->assertTrue( empty( $upload['error'] ) ); 329 329 … … 350 350 $contents = file_get_contents( $filename ); 351 351 352 $upload = wp_upload_bits( basename( $filename ), null, $contents );352 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 353 353 $this->assertTrue( empty( $upload['error'] ) ); 354 354 … … 378 378 $contents = file_get_contents( $filename ); 379 379 380 $upload = wp_upload_bits( basename( $filename ), null, $contents );380 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 381 381 $this->assertTrue( empty( $upload['error'] ) ); 382 382 … … 406 406 $contents = file_get_contents( $filename ); 407 407 408 $upload = wp_upload_bits( basename( $filename ), null, $contents );408 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 409 409 $this->assertTrue( empty( $upload['error'] ) ); 410 410 … … 433 433 $contents = file_get_contents( $filename ); 434 434 435 $upload = wp_upload_bits( basename( $filename ), null, $contents );435 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 436 436 $this->assertTrue( empty( $upload['error'] ) ); 437 437 … … 455 455 $contents = file_get_contents( $filename ); 456 456 457 $upload = wp_upload_bits( basename( $filename ), null, $contents );457 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 458 458 $attachment_id = $this->_make_attachment( $upload ); 459 459 … … 473 473 $contents = file_get_contents( $filename ); 474 474 475 $upload = wp_upload_bits( basename( $filename ), null, $contents );475 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 476 476 $attachment_id = $this->_make_attachment( $upload ); 477 477 … … 490 490 $contents = file_get_contents( $filename ); 491 491 492 $upload = wp_upload_bits( basename( $filename ), null, $contents );492 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 493 493 494 494 $this->assertFalse( $upload['error'] ); … … 496 496 add_filter( 'upload_mimes', array( $this, 'blacklist_jpg_mime_type' ) ); 497 497 498 $upload = wp_upload_bits( basename( $filename ), null, $contents );498 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 499 499 500 500 remove_filter( 'upload_mimes', array( $this, 'blacklist_jpg_mime_type' ) );
Note: See TracChangeset
for help on using the changeset viewer.