1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-28 08:09:54 +02:00

Add tests

This commit is contained in:
Oliver Vogel
2023-12-07 15:33:15 +01:00
parent e0c69e07c1
commit 59a4353661
2 changed files with 22 additions and 0 deletions

View File

@@ -41,4 +41,15 @@ class ResizeCanvasModifierTest extends TestCase
$this->assertColor(255, 255, 0, 255, $image->pickColor(17, 17));
$this->assertTransparency($image->pickColor(12, 1));
}
public function testModifyEdge(): void
{
$image = $this->createTestImage(1, 1);
$this->assertColor(255, 0, 0, 255, $image->pickColor(0, 0));
$image->modify(new ResizeCanvasModifier(null, 2, 'ff0', 'top'));
$this->assertEquals(1, $image->width());
$this->assertEquals(2, $image->height());
$this->assertColor(255, 255, 0, 255, $image->pickColor(0, 0));
$this->assertColor(255, 0, 0, 255, $image->pickColor(0, 1));
}
}

View File

@@ -41,4 +41,15 @@ class ResizeCanvasModifierTest extends TestCase
$this->assertColor(255, 255, 0, 255, $image->pickColor(17, 17));
$this->assertTransparency($image->pickColor(12, 1));
}
public function testModifyEdge(): void
{
$image = $this->createTestImage(1, 1);
$this->assertColor(255, 0, 0, 255, $image->pickColor(0, 0));
$image->modify(new ResizeCanvasModifier(null, 2, 'ff0', 'top'));
$this->assertEquals(1, $image->width());
$this->assertEquals(2, $image->height());
$this->assertColor(255, 255, 0, 255, $image->pickColor(0, 0));
$this->assertColor(255, 0, 0, 255, $image->pickColor(0, 1));
}
}