mirror of
https://github.com/Intervention/image.git
synced 2025-08-11 00:14:03 +02:00
Add tests for Image::blendTransparency()
This commit is contained in:
@@ -276,6 +276,15 @@ class ImageTest extends TestCase
|
|||||||
$this->assertColor(1, 2, 3, 4, $image->blendingColor());
|
$this->assertColor(1, 2, 3, 4, $image->blendingColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testBlendTransparency(): void
|
||||||
|
{
|
||||||
|
$image = $this->readTestImage('gradient.gif');
|
||||||
|
$this->assertColor(0, 0, 0, 0, $image->pickColor(1, 0));
|
||||||
|
$result = $image->blendTransparency('ff5500');
|
||||||
|
$this->assertColor(255, 85, 0, 255, $image->pickColor(1, 0));
|
||||||
|
$this->assertColor(255, 85, 0, 255, $result->pickColor(1, 0));
|
||||||
|
}
|
||||||
|
|
||||||
public function testToJpeg(): void
|
public function testToJpeg(): void
|
||||||
{
|
{
|
||||||
$this->assertMediaType('image/jpeg', (string) $this->image->toJpeg());
|
$this->assertMediaType('image/jpeg', (string) $this->image->toJpeg());
|
||||||
|
@@ -269,6 +269,15 @@ class ImageTest extends TestCase
|
|||||||
$this->assertColor(1, 2, 3, 4, $image->blendingColor());
|
$this->assertColor(1, 2, 3, 4, $image->blendingColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testBlendTransparency(): void
|
||||||
|
{
|
||||||
|
$image = $this->readTestImage('gradient.gif');
|
||||||
|
$this->assertColor(0, 0, 0, 0, $image->pickColor(1, 0));
|
||||||
|
$result = $image->blendTransparency('ff5500');
|
||||||
|
$this->assertColor(255, 85, 0, 255, $image->pickColor(1, 0));
|
||||||
|
$this->assertColor(255, 85, 0, 255, $result->pickColor(1, 0));
|
||||||
|
}
|
||||||
|
|
||||||
public function testToJpeg(): void
|
public function testToJpeg(): void
|
||||||
{
|
{
|
||||||
$this->assertMediaType('image/jpeg', (string) $this->image->toJpeg());
|
$this->assertMediaType('image/jpeg', (string) $this->image->toJpeg());
|
||||||
|
Reference in New Issue
Block a user