-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for EncodedImageObjectDecoder::class
- Loading branch information
1 parent
71540fd
commit b6d8154
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
tests/Unit/Drivers/Gd/Decoders/EncodedImageObjectDecoderTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Decoders; | ||
|
||
use Intervention\Image\Drivers\Gd\Decoders\EncodedImageObjectDecoder; | ||
use Intervention\Image\Drivers\Gd\Driver; | ||
use Intervention\Image\EncodedImage; | ||
use Intervention\Image\Image; | ||
use Intervention\Image\Tests\ImagickTestCase; | ||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\Attributes\RequiresPhpExtension; | ||
|
||
#[RequiresPhpExtension('gd')] | ||
#[CoversClass(EncodedImageObjectDecoder::class)] | ||
class EncodedImageObjectDecoderTest extends ImagickTestCase | ||
{ | ||
protected EncodedImageObjectDecoder $decoder; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->decoder = new EncodedImageObjectDecoder(); | ||
$this->decoder->setDriver(new Driver()); | ||
} | ||
|
||
public function testDecode(): void | ||
{ | ||
$result = $this->decoder->decode(new EncodedImage($this->getTestResourceData())); | ||
$this->assertInstanceOf(Image::class, $result); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
tests/Unit/Drivers/Imagick/Decoders/EncodedImageObjectDecoderTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Decoders; | ||
|
||
use Intervention\Image\Drivers\Imagick\Decoders\EncodedImageObjectDecoder; | ||
use Intervention\Image\Drivers\Imagick\Driver; | ||
use Intervention\Image\EncodedImage; | ||
use Intervention\Image\Image; | ||
use Intervention\Image\Tests\ImagickTestCase; | ||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\Attributes\RequiresPhpExtension; | ||
|
||
#[RequiresPhpExtension('imagick')] | ||
#[CoversClass(EncodedImageObjectDecoder::class)] | ||
class EncodedImageObjectDecoderTest extends ImagickTestCase | ||
{ | ||
protected EncodedImageObjectDecoder $decoder; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->decoder = new EncodedImageObjectDecoder(); | ||
$this->decoder->setDriver(new Driver()); | ||
} | ||
|
||
public function testDecode(): void | ||
{ | ||
$result = $this->decoder->decode(new EncodedImage($this->getTestResourceData())); | ||
$this->assertInstanceOf(Image::class, $result); | ||
} | ||
} |