mirror of
https://github.com/Intervention/image.git
synced 2025-08-06 13:56:30 +02:00
Move methods to global parent TestCase
This commit is contained in:
@@ -7,6 +7,16 @@ use Mockery\Adapter\Phpunit\MockeryTestCase;
|
|||||||
|
|
||||||
abstract class TestCase extends MockeryTestCase
|
abstract class TestCase extends MockeryTestCase
|
||||||
{
|
{
|
||||||
|
public function getTestImagePath($filename = 'test.jpg'): string
|
||||||
|
{
|
||||||
|
return sprintf('%s/images/%s', __DIR__, $filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTestImageData($filename = 'test.jpg'): string
|
||||||
|
{
|
||||||
|
return file_get_contents($this->getTestImagePath($filename));
|
||||||
|
}
|
||||||
|
|
||||||
protected function assertColor($r, $g, $b, $a, ColorInterface $color)
|
protected function assertColor($r, $g, $b, $a, ColorInterface $color)
|
||||||
{
|
{
|
||||||
$this->assertEquals($r, $color->red());
|
$this->assertEquals($r, $color->red());
|
||||||
|
@@ -9,16 +9,6 @@ use Intervention\Image\Drivers\Gd\Image;
|
|||||||
|
|
||||||
trait CanCreateGdTestImage
|
trait CanCreateGdTestImage
|
||||||
{
|
{
|
||||||
public function getTestImagePath($filename = 'test.jpg'): string
|
|
||||||
{
|
|
||||||
return sprintf('%s/../images/%s', __DIR__, $filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTestImageData($filename = 'test.jpg'): string
|
|
||||||
{
|
|
||||||
return file_get_contents($this->getTestImagePath($filename));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createTestImage($filename = 'test.jpg'): Image
|
public function createTestImage($filename = 'test.jpg'): Image
|
||||||
{
|
{
|
||||||
return $this->createWithImageDecoder()->handle(
|
return $this->createWithImageDecoder()->handle(
|
||||||
|
Reference in New Issue
Block a user