1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-02 18:32:56 +02:00

Rename test functions

This commit is contained in:
Oliver Vogel
2024-03-10 10:13:45 +01:00
parent 67fde5f87e
commit 03281ba995
29 changed files with 77 additions and 77 deletions

View File

@@ -25,7 +25,7 @@ final class Base64ImageDecoderTest extends BaseTestCase
public function testDecode(): void
{
$result = $this->decoder->decode(
base64_encode($this->getTestImageData('blue.gif'))
base64_encode($this->getTestResourceData('blue.gif'))
);
$this->assertInstanceOf(Image::class, $result);

View File

@@ -17,7 +17,7 @@ final class BinaryImageDecoderTest extends BaseTestCase
public function testDecodePng(): void
{
$decoder = new BinaryImageDecoder();
$image = $decoder->decode(file_get_contents($this->getTestImagePath('tile.png')));
$image = $decoder->decode(file_get_contents($this->getTestResourcePath('tile.png')));
$this->assertInstanceOf(Image::class, $image);
$this->assertInstanceOf(RgbColorspace::class, $image->colorspace());
$this->assertEquals(16, $image->width());
@@ -28,7 +28,7 @@ final class BinaryImageDecoderTest extends BaseTestCase
public function testDecodeGif(): void
{
$decoder = new BinaryImageDecoder();
$image = $decoder->decode(file_get_contents($this->getTestImagePath('red.gif')));
$image = $decoder->decode(file_get_contents($this->getTestResourcePath('red.gif')));
$this->assertInstanceOf(Image::class, $image);
$this->assertEquals(16, $image->width());
$this->assertEquals(16, $image->height());
@@ -38,7 +38,7 @@ final class BinaryImageDecoderTest extends BaseTestCase
public function testDecodeAnimatedGif(): void
{
$decoder = new BinaryImageDecoder();
$image = $decoder->decode(file_get_contents($this->getTestImagePath('cats.gif')));
$image = $decoder->decode(file_get_contents($this->getTestResourcePath('cats.gif')));
$this->assertInstanceOf(Image::class, $image);
$this->assertEquals(75, $image->width());
$this->assertEquals(50, $image->height());
@@ -48,7 +48,7 @@ final class BinaryImageDecoderTest extends BaseTestCase
public function testDecodeJpegWithExif(): void
{
$decoder = new BinaryImageDecoder();
$image = $decoder->decode(file_get_contents($this->getTestImagePath('exif.jpg')));
$image = $decoder->decode(file_get_contents($this->getTestResourcePath('exif.jpg')));
$this->assertInstanceOf(Image::class, $image);
$this->assertEquals(16, $image->width());
$this->assertEquals(16, $image->height());
@@ -59,7 +59,7 @@ final class BinaryImageDecoderTest extends BaseTestCase
public function testDecodeCmykImage(): void
{
$decoder = new BinaryImageDecoder();
$image = $decoder->decode(file_get_contents($this->getTestImagePath('cmyk.jpg')));
$image = $decoder->decode(file_get_contents($this->getTestResourcePath('cmyk.jpg')));
$this->assertInstanceOf(Image::class, $image);
$this->assertInstanceOf(CmykColorspace::class, $image->colorspace());
}

View File

@@ -26,7 +26,7 @@ final class DataUriImageDecoderTest extends BaseTestCase
public function testDecode(): void
{
$result = $this->decoder->decode(
sprintf('data:image/jpeg;base64,%s', base64_encode($this->getTestImageData('blue.gif')))
sprintf('data:image/jpeg;base64,%s', base64_encode($this->getTestResourceData('blue.gif')))
);
$this->assertInstanceOf(Image::class, $result);

View File

@@ -26,7 +26,7 @@ final class FilePathImageDecoderTest extends BaseTestCase
public function testDecode(): void
{
$result = $this->decoder->decode(
$this->getTestImagePath()
$this->getTestResourcePath()
);
$this->assertInstanceOf(Image::class, $result);

View File

@@ -17,7 +17,7 @@ final class FilePointerImageDecoderTest extends ImagickTestCase
public function testDecode(): void
{
$decoder = new FilePointerImageDecoder();
$fp = fopen($this->getTestImagePath('test.jpg'), 'r');
$fp = fopen($this->getTestResourcePath('test.jpg'), 'r');
$result = $decoder->decode($fp);
$this->assertInstanceOf(Image::class, $result);
}

View File

@@ -19,7 +19,7 @@ final class SplFileInfoImageDecoderTest extends BaseTestCase
{
$decoder = new SplFileInfoImageDecoder();
$result = $decoder->decode(
new SplFileInfo($this->getTestImagePath('blue.gif'))
new SplFileInfo($this->getTestResourcePath('blue.gif'))
);
$this->assertInstanceOf(Image::class, $result);
}

View File

@@ -37,8 +37,8 @@ final class DriverTest extends BaseTestCase
public function testCreateAnimation(): void
{
$image = $this->driver->createAnimation(function ($animation) {
$animation->add($this->getTestImagePath('red.gif'), .25);
$animation->add($this->getTestImagePath('green.gif'), .25);
$animation->add($this->getTestResourcePath('red.gif'), .25);
$animation->add($this->getTestResourcePath('green.gif'), .25);
})->setLoops(5);
$this->assertInstanceOf(ImageInterface::class, $image);
@@ -50,7 +50,7 @@ final class DriverTest extends BaseTestCase
public function testHandleInputImage(): void
{
$result = $this->driver->handleInput($this->getTestImagePath('test.jpg'));
$result = $this->driver->handleInput($this->getTestResourcePath('test.jpg'));
$this->assertInstanceOf(ImageInterface::class, $result);
}

View File

@@ -33,7 +33,7 @@ final class ImageTest extends ImagickTestCase
protected function setUp(): void
{
$imagick = new Imagick();
$imagick->readImage($this->getTestImagePath('animation.gif'));
$imagick->readImage($this->getTestResourcePath('animation.gif'));
$this->image = new Image(
new Driver(),
new Core($imagick),

View File

@@ -29,7 +29,7 @@ final class InputHandlerTest extends BaseTestCase
public function testHandleBinaryImage(): void
{
$handler = new InputHandler();
$input = file_get_contents($this->getTestImagePath('animation.gif'));
$input = file_get_contents($this->getTestResourcePath('animation.gif'));
$result = $handler->handle($input);
$this->assertInstanceOf(Image::class, $result);
}
@@ -37,7 +37,7 @@ final class InputHandlerTest extends BaseTestCase
public function testHandleSplFileInfo(): void
{
$handler = new InputHandler();
$input = new SplFileInfo($this->getTestImagePath('test.jpg'));
$input = new SplFileInfo($this->getTestResourcePath('test.jpg'));
$result = $handler->handle($input);
$this->assertInstanceOf(Image::class, $result);
}
@@ -45,7 +45,7 @@ final class InputHandlerTest extends BaseTestCase
public function testHandleFilePathImage(): void
{
$handler = new InputHandler();
$input = $this->getTestImagePath('animation.gif');
$input = $this->getTestResourcePath('animation.gif');
$result = $handler->handle($input);
$this->assertInstanceOf(Image::class, $result);
}
@@ -53,7 +53,7 @@ final class InputHandlerTest extends BaseTestCase
public function testHandleBase64Image(): void
{
$handler = new InputHandler();
$input = base64_encode(file_get_contents($this->getTestImagePath('animation.gif')));
$input = base64_encode(file_get_contents($this->getTestResourcePath('animation.gif')));
$result = $handler->handle($input);
$this->assertInstanceOf(Image::class, $result);
}

View File

@@ -18,7 +18,7 @@ final class PlaceModifierTest extends ImagickTestCase
{
$image = $this->readTestImage('test.jpg');
$this->assertEquals('febc44', $image->pickColor(300, 25)->toHex());
$image->modify(new PlaceModifier($this->getTestImagePath('circle.png'), 'top-right', 0, 0));
$image->modify(new PlaceModifier($this->getTestResourcePath('circle.png'), 'top-right', 0, 0));
$this->assertEquals('33260e', $image->pickColor(300, 25)->toHex());
}
@@ -26,7 +26,7 @@ final class PlaceModifierTest extends ImagickTestCase
{
$image = $this->readTestImage('test.jpg');
$this->assertEquals('febc44', $image->pickColor(300, 25)->toHex());
$image->modify(new PlaceModifier($this->getTestImagePath('circle.png'), 'top-right', 0, 0, 50));
$image->modify(new PlaceModifier($this->getTestResourcePath('circle.png'), 'top-right', 0, 0, 50));
$this->assertEquals('987129', $image->pickColor(300, 25)->toHex());
}
}