Changeset 50250 for branches/3.8/tests/phpunit/tests/image/base.php
- Timestamp:
- 02/08/2021 08:57:54 PM (4 years ago)
- Location:
- branches/3.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.8
- 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.8/tests/phpunit/tests/image/base.php
r47338 r50250 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 48 48 $im = imagecreatefrompng( $image_path ); … … 53 53 $this->assertEquals( $alpha, $colors['alpha'] ); 54 54 } 55 56 /** 57 * Helper assertion for testing alpha on images using Imagick 58 * 59 * @param string $image_path 60 * @param array $point array(x,y) 61 * @param int $expected 62 */ 63 protected function assertImageAlphaAtPointImagick( $image_path, $point, $expected ) { 64 $im = new Imagick( $image_path ); 65 $pixel = $im->getImagePixelColor( $point[0], $point[1] ); 66 $color = $pixel->getColorValue( imagick::COLOR_ALPHA ); 67 $this->assertEquals( $expected, $color ); 68 } 55 69 }
Note: See TracChangeset
for help on using the changeset viewer.