Changeset 27794 for trunk/tests/phpunit/tests/image/base.php
- Timestamp:
- 03/27/2014 08:39:08 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/image/base.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/base.php
r25002 r27794 40 40 */ 41 41 protected function assertImageAlphaAtPoint( $image_path, $point, $alpha ) { 42 $im = imagecreatefrompng( $image_path ); 43 $rgb = imagecolorat( $im, $point[0], $point[1] ); 42 44 43 $im = imagecreatefrompng( $image_path ); 44 $rgb = imagecolorat($im, $point[0], $point[1]); 45 46 $colors = imagecolorsforindex($im, $rgb); 45 $colors = imagecolorsforindex( $im, $rgb ); 47 46 48 47 $this->assertEquals( $alpha, $colors['alpha'] ); 49 48 } 49 50 /** 51 * Helper assertion to check actual image dimensions on disk 52 * 53 * @param string $filename Image filename. 54 * @param int $width Width to verify. 55 * @param int $height Height to verify. 56 */ 57 protected function assertImageDimensions( $filename, $width, $height ) { 58 $detected_width = 0; 59 $detected_height = 0; 60 $image_size = @getimagesize( $filename ); 61 62 if ( isset( $image_size[0] ) ) { 63 $detected_width = $image_size[0]; 64 } 65 66 if ( isset( $image_size[1] ) ) { 67 $detected_height = $image_size[1]; 68 } 69 70 $this->assertEquals( $width, $detected_width ); 71 $this->assertEquals( $height, $detected_height ); 72 } 50 73 }
Note: See TracChangeset
for help on using the changeset viewer.