mirror of
https://github.com/Intervention/image.git
synced 2025-08-30 01:00:06 +02:00
Optimize tests
This commit is contained in:
@@ -4,21 +4,20 @@ declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Unit\Geometry;
|
||||
|
||||
use Intervention\Image\Colors\Rgb\Color;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Intervention\Image\Geometry\Pixel;
|
||||
use Intervention\Image\Interfaces\ColorInterface;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Mockery;
|
||||
|
||||
#[CoversClass(\Intervention\Image\Geometry\Pixel::class)]
|
||||
#[CoversClass(Pixel::class)]
|
||||
final class PixelTest extends BaseTestCase
|
||||
{
|
||||
public function testSetGetBackground(): void
|
||||
{
|
||||
$color = Mockery::mock(ColorInterface::class);
|
||||
$pixel = new Pixel($color, 10, 12);
|
||||
$color = new Color(255, 55, 0);
|
||||
$pixel = new Pixel(new Color(0, 0, 0), 10, 12);
|
||||
$result = $pixel->setBackgroundColor($color);
|
||||
$this->assertInstanceOf(ColorInterface::class, $pixel->backgroundColor());
|
||||
$this->assertEquals($color, $pixel->backgroundColor());
|
||||
$this->assertInstanceOf(Pixel::class, $result);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user