Changeset 31510 for trunk/tests/phpunit/tests/image/editor_gd.php
- Timestamp:
- 02/22/2015 09:06:36 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/editor_gd.php
r31040 r31510 32 32 } 33 33 34 /** 35 * Check support for GD compatible mime types. 36 */ 37 public function test_supports_mime_type() { 34 public function test_supports_mime_type_jpeg() { 38 35 $gd_image_editor = new WP_Image_Editor_GD( null ); 39 40 $this->assertTrue( $gd_image_editor->supports_mime_type( 'image/jpeg' ), 'Does not support image/jpeg' ); 41 $this->assertTrue( $gd_image_editor->supports_mime_type( 'image/png' ), 'Does not support image/png' ); 42 $this->assertTrue( $gd_image_editor->supports_mime_type( 'image/gif' ), 'Does not support image/gif' ); 36 $expected = imagetypes() & IMG_JPG; 37 $this->assertEquals( $expected, $gd_image_editor->supports_mime_type( 'image/jpeg' ) ); 38 } 39 40 public function test_supports_mime_type_png() { 41 $gd_image_editor = new WP_Image_Editor_GD( null ); 42 $expected = imagetypes() & IMG_PNG; 43 $this->assertEquals( $expected, $gd_image_editor->supports_mime_type( 'image/png' ) ); 44 } 45 46 public function test_supports_mime_type_gif() { 47 $gd_image_editor = new WP_Image_Editor_GD( null ); 48 $expected = imagetypes() & IMG_GIF; 49 $this->assertEquals( $expected, $gd_image_editor->supports_mime_type( 'image/gif' ) ); 43 50 } 44 51 … … 461 468 */ 462 469 public function test_image_preserves_alpha_on_resize() { 470 if ( ! ( imagetypes() & IMG_PNG ) ) { 471 $this->markTestSkipped( 'This test requires PHP to be compiled with PNG support.' ); 472 } 473 463 474 $file = DIR_TESTDATA . '/images/transparent.png'; 464 475 … … 484 495 */ 485 496 public function test_image_preserves_alpha() { 497 if ( ! ( imagetypes() & IMG_PNG ) ) { 498 $this->markTestSkipped( 'This test requires PHP to be compiled with PNG support.' ); 499 } 500 486 501 $file = DIR_TESTDATA . '/images/transparent.png'; 487 502 … … 506 521 */ 507 522 public function test_image_preserves_alpha_on_rotate() { 523 if ( ! ( imagetypes() & IMG_PNG ) ) { 524 $this->markTestSkipped( 'This test requires PHP to be compiled with PNG support.' ); 525 } 526 508 527 $file = DIR_TESTDATA . '/images/transparent.png'; 509 528
Note: See TracChangeset
for help on using the changeset viewer.