Changeset 48937 for trunk/tests/phpunit/tests/image/editorGd.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/editorGd.php
r47198 r48937 35 35 public function test_supports_mime_type_jpeg() { 36 36 $gd_image_editor = new WP_Image_Editor_GD( null ); 37 $expected = imagetypes() & IMG_JPG;38 $this->assert Equals( $expected, $gd_image_editor->supports_mime_type( 'image/jpeg' ) );37 $expected = (bool) ( imagetypes() & IMG_JPG ); 38 $this->assertSame( $expected, $gd_image_editor->supports_mime_type( 'image/jpeg' ) ); 39 39 } 40 40 41 41 public function test_supports_mime_type_png() { 42 42 $gd_image_editor = new WP_Image_Editor_GD( null ); 43 $expected = imagetypes() & IMG_PNG;44 $this->assert Equals( $expected, $gd_image_editor->supports_mime_type( 'image/png' ) );43 $expected = (bool) ( imagetypes() & IMG_PNG ); 44 $this->assertSame( $expected, $gd_image_editor->supports_mime_type( 'image/png' ) ); 45 45 } 46 46 47 47 public function test_supports_mime_type_gif() { 48 48 $gd_image_editor = new WP_Image_Editor_GD( null ); 49 $expected = imagetypes() & IMG_GIF;50 $this->assert Equals( $expected, $gd_image_editor->supports_mime_type( 'image/gif' ) );49 $expected = (bool) ( imagetypes() & IMG_GIF ); 50 $this->assertSame( $expected, $gd_image_editor->supports_mime_type( 'image/gif' ) ); 51 51 } 52 52 … … 62 62 $gd_image_editor->resize( 100, 50 ); 63 63 64 $this->assert Equals(64 $this->assertSame( 65 65 array( 66 66 'width' => 75, … … 99 99 ); 100 100 101 $this->assert Equals( $expected_array, $resized );101 $this->assertSame( $expected_array, $resized ); 102 102 103 103 // Now, verify real dimensions are as expected. … … 371 371 372 372 $this->assertNotNull( $resized ); 373 $this->assert Equals( $expected_array, $resized );373 $this->assertSame( $expected_array, $resized ); 374 374 375 375 foreach ( $resized as $key => $image_data ) { … … 396 396 $gd_image_editor->resize( 100, 50, true ); 397 397 398 $this->assert Equals(398 $this->assertSame( 399 399 array( 400 400 'width' => 100, … … 416 416 $gd_image_editor->crop( 0, 0, 50, 50 ); 417 417 418 $this->assert Equals(418 $this->assertSame( 419 419 array( 420 420 'width' => 50, … … 441 441 $gd_image_editor->rotate( 180 ); 442 442 443 $this->assert Equals( $color_top_left, imagecolorat( $property->getValue( $gd_image_editor ), 99, 99 ) );443 $this->assertSame( $color_top_left, imagecolorat( $property->getValue( $gd_image_editor ), 99, 99 ) ); 444 444 } 445 445 … … 460 460 $gd_image_editor->flip( true, false ); 461 461 462 $this->assert Equals( $color_top_left, imagecolorat( $property->getValue( $gd_image_editor ), 0, 99 ) );462 $this->assertSame( $color_top_left, imagecolorat( $property->getValue( $gd_image_editor ), 0, 99 ) ); 463 463 } 464 464
Note: See TracChangeset
for help on using the changeset viewer.