1
0
mirror of https://github.com/Intervention/image.git synced 2025-01-17 04:08:14 +01:00

Move methods to global parent TestCase

This commit is contained in:
Oliver Vogel 2023-10-03 10:08:37 +02:00
parent 41efb89373
commit b57717da3d
2 changed files with 10 additions and 10 deletions

View File

@ -7,6 +7,16 @@ use Mockery\Adapter\Phpunit\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)
{
$this->assertEquals($r, $color->red());

View File

@ -9,16 +9,6 @@ use Intervention\Image\Drivers\Gd\Image;
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
{
return $this->createWithImageDecoder()->handle(