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