Changeset 48937 for trunk/tests/phpunit/tests/image/resize.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/resize.php
r47198 r48937 30 30 $image = $this->resize_helper( DIR_TESTDATA . '/images/test-image.jpg', 25, 25 ); 31 31 32 $this->assert Equals( 'test-image-25x25.jpg', wp_basename( $image ) );32 $this->assertSame( 'test-image-25x25.jpg', wp_basename( $image ) ); 33 33 list($w, $h, $type) = getimagesize( $image ); 34 $this->assert Equals( 25, $w );35 $this->assert Equals( 25, $h );36 $this->assert Equals( IMAGETYPE_JPEG, $type );34 $this->assertSame( 25, $w ); 35 $this->assertSame( 25, $h ); 36 $this->assertSame( IMAGETYPE_JPEG, $type ); 37 37 38 38 unlink( $image ); … … 46 46 } 47 47 48 $this->assert Equals( 'test-image-25x25.png', wp_basename( $image ) );48 $this->assertSame( 'test-image-25x25.png', wp_basename( $image ) ); 49 49 list($w, $h, $type) = getimagesize( $image ); 50 $this->assert Equals( 25, $w );51 $this->assert Equals( 25, $h );52 $this->assert Equals( IMAGETYPE_PNG, $type );50 $this->assertSame( 25, $w ); 51 $this->assertSame( 25, $h ); 52 $this->assertSame( IMAGETYPE_PNG, $type ); 53 53 54 54 unlink( $image ); … … 62 62 } 63 63 64 $this->assert Equals( 'test-image-25x25.gif', wp_basename( $image ) );64 $this->assertSame( 'test-image-25x25.gif', wp_basename( $image ) ); 65 65 list($w, $h, $type) = getimagesize( $image ); 66 $this->assert Equals( 25, $w );67 $this->assert Equals( 25, $h );68 $this->assert Equals( IMAGETYPE_GIF, $type );66 $this->assertSame( 25, $w ); 67 $this->assertSame( 25, $h ); 68 $this->assertSame( IMAGETYPE_GIF, $type ); 69 69 70 70 unlink( $image ); … … 76 76 77 77 $this->assertInstanceOf( 'WP_Error', $image ); 78 $this->assert Equals( 'error_getting_dimensions', $image->get_error_code() );78 $this->assertSame( 'error_getting_dimensions', $image->get_error_code() ); 79 79 } 80 80 … … 82 82 $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 96 ); 83 83 84 $this->assert Equals( '2007-06-17DSC_4173-64x96.jpg', wp_basename( $image ) );84 $this->assertSame( '2007-06-17DSC_4173-64x96.jpg', wp_basename( $image ) ); 85 85 list($w, $h, $type) = getimagesize( $image ); 86 $this->assert Equals( 64, $w );87 $this->assert Equals( 96, $h );88 $this->assert Equals( IMAGETYPE_JPEG, $type );86 $this->assertSame( 64, $w ); 87 $this->assertSame( 96, $h ); 88 $this->assertSame( IMAGETYPE_JPEG, $type ); 89 89 90 90 unlink( $image ); … … 94 94 $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 0 ); 95 95 96 $this->assert Equals( '2007-06-17DSC_4173-128x193.jpg', wp_basename( $image ) );96 $this->assertSame( '2007-06-17DSC_4173-128x193.jpg', wp_basename( $image ) ); 97 97 list($w, $h, $type) = getimagesize( $image ); 98 $this->assert Equals( 128, $w );99 $this->assert Equals( 193, $h );100 $this->assert Equals( IMAGETYPE_JPEG, $type );98 $this->assertSame( 128, $w ); 99 $this->assertSame( 193, $h ); 100 $this->assertSame( IMAGETYPE_JPEG, $type ); 101 101 102 102 unlink( $image ); … … 106 106 $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 0, 96 ); 107 107 108 $this->assert Equals( '2007-06-17DSC_4173-64x96.jpg', wp_basename( $image ) );108 $this->assertSame( '2007-06-17DSC_4173-64x96.jpg', wp_basename( $image ) ); 109 109 list($w, $h, $type) = getimagesize( $image ); 110 $this->assert Equals( 64, $w );111 $this->assert Equals( 96, $h );112 $this->assert Equals( IMAGETYPE_JPEG, $type );110 $this->assertSame( 64, $w ); 111 $this->assertSame( 96, $h ); 112 $this->assertSame( IMAGETYPE_JPEG, $type ); 113 113 114 114 unlink( $image ); … … 118 118 $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 150, 150, true ); 119 119 120 $this->assert Equals( '2007-06-17DSC_4173-150x150.jpg', wp_basename( $image ) );120 $this->assertSame( '2007-06-17DSC_4173-150x150.jpg', wp_basename( $image ) ); 121 121 list($w, $h, $type) = getimagesize( $image ); 122 $this->assert Equals( 150, $w );123 $this->assert Equals( 150, $h );124 $this->assert Equals( IMAGETYPE_JPEG, $type );122 $this->assertSame( 150, $w ); 123 $this->assertSame( 150, $h ); 124 $this->assertSame( IMAGETYPE_JPEG, $type ); 125 125 126 126 unlink( $image ); … … 130 130 $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 150, 100, true ); 131 131 132 $this->assert Equals( '2007-06-17DSC_4173-150x100.jpg', wp_basename( $image ) );132 $this->assertSame( '2007-06-17DSC_4173-150x100.jpg', wp_basename( $image ) ); 133 133 list($w, $h, $type) = getimagesize( $image ); 134 $this->assert Equals( 150, $w );135 $this->assert Equals( 100, $h );136 $this->assert Equals( IMAGETYPE_JPEG, $type );134 $this->assertSame( 150, $w ); 135 $this->assertSame( 100, $h ); 136 $this->assertSame( IMAGETYPE_JPEG, $type ); 137 137 138 138 unlink( $image ); … … 142 142 $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 50, 150, true ); 143 143 144 $this->assert Equals( '2007-06-17DSC_4173-50x150.jpg', wp_basename( $image ) );144 $this->assertSame( '2007-06-17DSC_4173-50x150.jpg', wp_basename( $image ) ); 145 145 list($w, $h, $type) = getimagesize( $image ); 146 $this->assert Equals( 50, $w );147 $this->assert Equals( 150, $h );148 $this->assert Equals( IMAGETYPE_JPEG, $type );146 $this->assertSame( 50, $w ); 147 $this->assertSame( 150, $h ); 148 $this->assertSame( IMAGETYPE_JPEG, $type ); 149 149 150 150 unlink( $image ); … … 160 160 161 161 $this->assertInstanceOf( 'WP_Error', $image ); 162 $this->assert Equals( 'error_loading_image', $image->get_error_code() );162 $this->assertSame( 'error_loading_image', $image->get_error_code() ); 163 163 } 164 164
Note: See TracChangeset
for help on using the changeset viewer.