Skip to content

Commit

Permalink
Remove mock from imagick testWebpFormatIsAllowedAsAnimatedFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Dec 3, 2024
1 parent 25b8f45 commit 15eea87
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions tests/tests/Imagick/LayersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,12 @@ public function testCount()

public function testWebpFormatIsAllowedAsAnimatedFormat()
{
$palette = new RGB();
$resource = $this->getMockBuilder('\Imagick')->getMock();

$resource->expects($this->atLeastOnce())
->method('getNumberImages')
->will($this->returnValue(42));

$resource->expects($this->atLeastOnce())
->method('getImage')
->will($this->returnValue($resource));

$layers = new Layers(new Image($resource, $palette, new MetadataBag()), $palette, $resource);

$layers->animate('webp', 200, 0);
$image = $this->getImagine()->open(IMAGINE_TEST_FIXTURESFOLDER . '/anima3.gif');
$originalDelayInTicks = $image->layers()->get(0)->getImagick()->getImageDelay();
$image->layers()->animate('webp', (int) (1000 + $originalDelayInTicks * 1000 / 20), 0);
$this->assertSame('webp', $image->getImagick()->getFormat());
$newDelayInTicks = $image->layers()->get(0)->getImagick()->getImageDelay();
$this->assertNotEquals($originalDelayInTicks, $newDelayInTicks);
}

public function testGetLayer()
Expand Down

0 comments on commit 15eea87

Please sign in to comment.