Skip to content

Commit 9ac71ce

Browse files
authored
Merge pull request #1989 from ShyamGadde/fix/phpunit-failing-tests
Fix PHPUnit tests failing for dominant-color-images
2 parents d769a47 + 70a3999 commit 9ac71ce

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

plugins/dominant-color-images/tests/test-dominant-color-image-editor-imagick.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -168,34 +168,4 @@ public function test_has_transparency_with_transparency(): void {
168168

169169
$this->assertTrue( $result );
170170
}
171-
172-
/**
173-
* @covers ::has_transparency
174-
*/
175-
public function test_has_transparency_no_alpha_channel_method(): void {
176-
// Mock the Imagick object to simulate when getImageAlphaChannel method doesn't exist.
177-
$imagick_mock = $this->getMockBuilder( Imagick::class )
178-
->disableOriginalConstructor()
179-
->getMock();
180-
181-
$imagick_mock->method( 'getImageWidth' )->willReturn( 1 );
182-
$imagick_mock->method( 'getImageHeight' )->willReturn( 1 );
183-
184-
$pixel = $this->getMockBuilder( ImagickPixel::class )
185-
->disableOriginalConstructor()
186-
->getMock();
187-
$pixel->method( 'getColor' )->willReturn( array( 'a' => 0 ) );
188-
189-
$imagick_mock->method( 'getImagePixelColor' )->willReturn( $pixel );
190-
191-
$editor = new Dominant_Color_Image_Editor_Imagick( null );
192-
$reflection = new ReflectionClass( $editor );
193-
$property = $reflection->getProperty( 'image' );
194-
$property->setAccessible( true );
195-
$property->setValue( $editor, $imagick_mock );
196-
197-
$result = $editor->has_transparency();
198-
199-
$this->assertFalse( $result );
200-
}
201171
}

0 commit comments

Comments
 (0)