-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
017f3da
commit e2c1ed1
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
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
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,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Intervention\MimeSniffer\Types; | ||
|
||
use Intervention\MimeSniffer\AbstractBinaryType; | ||
|
||
class ImageJpeg2000 extends AbstractBinaryType | ||
{ | ||
/** | ||
* Name of content type | ||
* | ||
* @var string | ||
*/ | ||
public $name = 'image/jp2'; | ||
|
||
/** | ||
* Signature pattern | ||
* | ||
* @var string | ||
*/ | ||
protected $pattern = "/^0000000C6A5020200D0A870A/"; | ||
} |
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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Intervention\MimeSniffer\Tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Intervention\MimeSniffer\MimeSniffer; | ||
use Intervention\MimeSniffer\Types\ImageJpeg2000; | ||
|
||
final class ImageJpeg2000Test extends TestCase | ||
{ | ||
public $sniffer; | ||
public $type; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.jp2'); | ||
$this->type = $this->sniffer->getType(); | ||
} | ||
|
||
public function testType(): void | ||
{ | ||
$this->assertInstanceOf(ImageJpeg2000::class, $this->type); | ||
} | ||
|
||
public function testIsImage(): void | ||
{ | ||
$this->assertTrue($this->type->isImage()); | ||
} | ||
} |
Binary file not shown.