Changeset 50249 for branches/3.9/tests/phpunit/tests/image/base.php
- Timestamp:
- 02/08/2021 08:57:07 PM (4 years ago)
- Location:
- branches/3.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.9
- Property svn:mergeinfo changed
/branches/5.0 merged: 43836 /trunk merged: 44176,45445,45745,45762,45783-45784,45800,45819,45885,46320,46999,47225,47912,48121,49267,49335,49358,49360,49362
- Property svn:mergeinfo changed
-
branches/3.9/tests/phpunit/tests/image/base.php
r47329 r50249 38 38 39 39 /** 40 * Helper assertion for testing alpha on images 40 * Helper assertion for testing alpha on images using GD library 41 41 * 42 42 * @param string $image_path … … 44 44 * @param int $alpha 45 45 */ 46 protected function assertImageAlphaAtPoint ( $image_path, $point, $alpha ) {46 protected function assertImageAlphaAtPointGD( $image_path, $point, $alpha ) { 47 47 $im = imagecreatefrompng( $image_path ); 48 48 $rgb = imagecolorat( $im, $point[0], $point[1] ); … … 51 51 52 52 $this->assertEquals( $alpha, $colors['alpha'] ); 53 } 54 55 /** 56 * Helper assertion for testing alpha on images using Imagick 57 * 58 * @param string $image_path 59 * @param array $point array(x,y) 60 * @param int $expected 61 */ 62 protected function assertImageAlphaAtPointImagick( $image_path, $point, $expected ) { 63 $im = new Imagick( $image_path ); 64 $pixel = $im->getImagePixelColor( $point[0], $point[1] ); 65 $color = $pixel->getColorValue( imagick::COLOR_ALPHA ); 66 $this->assertEquals( $expected, $color ); 53 67 } 54 68
Note: See TracChangeset
for help on using the changeset viewer.