Make WordPress Core


Ignore:
Timestamp:
11/24/2014 08:56:36 PM (10 years ago)
Author:
boonebgorges
Message:

Fix the unit tests for Imagick alpha.

These tests were written to use the assertImageAtAlpha() helper method, whose
internals were specific to GD. As a result, the tests could not pass. This
changeset introduces GD- and Imagick-specific versions of this method.

Props voldemortensen.
Fixes #24871.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/image/editor_imagick.php

    r29834 r30549  
    473473        $editor->save( $save_to_file );
    474474
    475         $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
     475        $im = new Imagick( $save_to_file );
     476        $pixel = $im->getImagePixelColor( 0, 0 );
     477        $expected = $pixel->getColorValue( imagick::COLOR_ALPHA );
     478
     479        $this->assertImageAlphaAtPointImagick( $save_to_file, array( 0,0 ), $expected );
    476480
    477481        unlink( $save_to_file );
     
    496500        $editor->save( $save_to_file );
    497501
    498         $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
     502        $im = new Imagick( $save_to_file );
     503        $pixel = $im->getImagePixelColor( 0, 0 );
     504        $expected = $pixel->getColorValue( imagick::COLOR_ALPHA );
     505
     506        $this->assertImageAlphaAtPointImagick( $save_to_file, array( 0,0 ), $expected );
    499507
    500508        unlink( $save_to_file );
Note: See TracChangeset for help on using the changeset viewer.