diff --git a/.gitignore b/.gitignore
index b175236..47991ba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,4 @@ composer.lock
vendor/
dev/
.idea/
-.phpunit.result.cache
+/.phpunit.cache
diff --git a/composer.json b/composer.json
index 4a586d6..5841224 100644
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,12 @@
"name": "intervention/mimesniffer",
"description": "PHP MIME Type Sniffer",
"homepage": "http://intervention.io/",
- "keywords": ["mime", "type", "sniffer", "detector"],
+ "keywords": [
+ "mime",
+ "type",
+ "sniffer",
+ "detector"
+ ],
"license": "MIT",
"authors": [
{
@@ -15,7 +20,7 @@
"php": "^7.3|^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^9",
+ "phpunit/phpunit": "^10.0",
"phpstan/phpstan": "^1"
},
"autoload": {
diff --git a/docker-compose.yml b/docker-compose.yml
index 8d90fbf..4cca254 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -4,7 +4,7 @@ services:
tests:
build: ./
working_dir: /project
- command: bash -c "composer install && ./vendor/bin/phpunit -vvv"
+ command: bash -c "composer install && ./vendor/bin/phpunit"
volumes:
- ./:/project
analysis:
diff --git a/phpunit.xml b/phpunit.xml
deleted file mode 100644
index 422eeac..0000000
--- a/phpunit.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
- ./tests/
-
-
-
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
new file mode 100644
index 0000000..8cb3e1c
--- /dev/null
+++ b/phpunit.xml.dist
@@ -0,0 +1,8 @@
+
+
+
+
+ ./tests/
+
+
+
diff --git a/tests/AbstractBinaryTypeTest.php b/tests/AbstractBinaryTypeTest.php
index 0c456bd..e68ba19 100644
--- a/tests/AbstractBinaryTypeTest.php
+++ b/tests/AbstractBinaryTypeTest.php
@@ -5,9 +5,9 @@
use PHPUnit\Framework\TestCase;
use Intervention\MimeSniffer\AbstractBinaryType;
-class AbstractBinaryTypeTest extends TestCase
+final class AbstractBinaryTypeTest extends TestCase
{
- public function testPrepareContent()
+ public function testPrepareContent(): void
{
$content = '';
for ($i = 0; $i < 2048; $i++) {
@@ -19,7 +19,7 @@ public function testPrepareContent()
$this->assertEquals('78787878', substr($type->prepareContent($content), 0, 8));
}
- public function testIsBinary()
+ public function testIsBinary(): void
{
$type = $this->getMockForAbstractClass(AbstractBinaryType::class);
$this->assertTrue($type->isBinary());
diff --git a/tests/AbstractTypeTest.php b/tests/AbstractTypeTest.php
index 42227ac..ee25b2b 100644
--- a/tests/AbstractTypeTest.php
+++ b/tests/AbstractTypeTest.php
@@ -5,27 +5,27 @@
use PHPUnit\Framework\TestCase;
use Intervention\MimeSniffer\AbstractType;
-class AbstractTypeTest extends TestCase
+final class AbstractTypeTest extends TestCase
{
- public function testToString()
+ public function testToString(): void
{
$type = $this->getMockForAbstractClass(AbstractType::class);
$this->assertEquals('', $type);
}
- public function testMatches()
+ public function testMatches(): void
{
$type = $this->getMockForAbstractClass(AbstractType::class);
$this->assertFalse($type->matches('test'));
}
- public function testIsImage()
+ public function testIsImage(): void
{
$type = $this->getMockForAbstractClass(AbstractType::class);
$this->assertFalse($type->isImage());
}
- public function testPrepareContent()
+ public function testPrepareContent(): void
{
$content = '';
for ($i = 0; $i < 2048; $i++) {
@@ -36,7 +36,7 @@ public function testPrepareContent()
$this->assertEquals(1024, strlen($type->prepareContent($content)));
}
- public function testIsBinary()
+ public function testIsBinary(): void
{
$type = $this->getMockForAbstractClass(AbstractType::class);
$this->assertFalse($type->isBinary());
diff --git a/tests/ApplicationGzipTest.php b/tests/ApplicationGzipTest.php
index 350c812..e99e434 100644
--- a/tests/ApplicationGzipTest.php
+++ b/tests/ApplicationGzipTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ApplicationGzip;
-class ApplicationGzipTest extends TestCase
+final class ApplicationGzipTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ApplicationGzip::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertFalse($this->type->isImage());
}
diff --git a/tests/ApplicationOggTest.php b/tests/ApplicationOggTest.php
index 9b28deb..30b074f 100644
--- a/tests/ApplicationOggTest.php
+++ b/tests/ApplicationOggTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ApplicationOgg;
-class ApplicationOggTest extends TestCase
+final class ApplicationOggTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ApplicationOgg::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertFalse($this->type->isImage());
}
diff --git a/tests/ApplicationPdfTest.php b/tests/ApplicationPdfTest.php
index 13dcb1d..7c80d61 100644
--- a/tests/ApplicationPdfTest.php
+++ b/tests/ApplicationPdfTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ApplicationPdf;
-class ApplicationPdfTest extends TestCase
+final class ApplicationPdfTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ApplicationPdf::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertFalse($this->type->isImage());
}
diff --git a/tests/ApplicationRarTest.php b/tests/ApplicationRarTest.php
index 31c3562..92f67d6 100644
--- a/tests/ApplicationRarTest.php
+++ b/tests/ApplicationRarTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ApplicationRar;
-class ApplicationRarTest extends TestCase
+final class ApplicationRarTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ApplicationRar::class, $this->type);
}
- public function testIsArchive()
+ public function testIsArchive(): void
{
$this->assertTrue($this->type->isArchive());
}
diff --git a/tests/ApplicationSqliteTest.php b/tests/ApplicationSqliteTest.php
index f86da8b..c437e5e 100644
--- a/tests/ApplicationSqliteTest.php
+++ b/tests/ApplicationSqliteTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ApplicationSqlite;
-class ApplicationSqliteTest extends TestCase
+final class ApplicationSqliteTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,7 +17,7 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ApplicationSqlite::class, $this->type);
}
diff --git a/tests/ApplicationTarTest.php b/tests/ApplicationTarTest.php
index 80c32ee..24bfabd 100644
--- a/tests/ApplicationTarTest.php
+++ b/tests/ApplicationTarTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ApplicationTar;
-class ApplicationTarTest extends TestCase
+final class ApplicationTarTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ApplicationTar::class, $this->type);
}
- public function testIsArchive()
+ public function testIsArchive(): void
{
$this->assertTrue($this->type->isArchive());
}
diff --git a/tests/ApplicationZipTest.php b/tests/ApplicationZipTest.php
index d8e51c3..32fa747 100644
--- a/tests/ApplicationZipTest.php
+++ b/tests/ApplicationZipTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ApplicationZip;
-class ApplicationZipTest extends TestCase
+final class ApplicationZipTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ApplicationZip::class, $this->type);
}
- public function testIsArchive()
+ public function testIsArchive(): void
{
$this->assertTrue($this->type->isArchive());
}
diff --git a/tests/AudioFlacTest.php b/tests/AudioFlacTest.php
index cc21af8..c6251df 100644
--- a/tests/AudioFlacTest.php
+++ b/tests/AudioFlacTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\AudioFlac;
-class AudioFlacTest extends TestCase
+final class AudioFlacTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(AudioFlac::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertFalse($this->type->isImage());
}
diff --git a/tests/AudioMpegId3v2Test.php b/tests/AudioMpegId3v2Test.php
index df337ee..48335f9 100644
--- a/tests/AudioMpegId3v2Test.php
+++ b/tests/AudioMpegId3v2Test.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\AudioMpeg;
-class AudioMpegId3v2Test extends TestCase
+final class AudioMpegId3v2Test extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(AudioMpeg::class, $this->type);
}
- public function testIsAudio()
+ public function testIsAudio(): void
{
$this->assertTrue($this->type->isAudio());
}
diff --git a/tests/AudioMpegTest.php b/tests/AudioMpegTest.php
index e938b5d..99d0a70 100644
--- a/tests/AudioMpegTest.php
+++ b/tests/AudioMpegTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\AudioMpeg;
-class AudioMpegTest extends TestCase
+final class AudioMpegTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(AudioMpeg::class, $this->type);
}
- public function testIsAudio()
+ public function testIsAudio(): void
{
$this->assertTrue($this->type->isAudio());
}
diff --git a/tests/ImageAvifTest.php b/tests/ImageAvifTest.php
index 8666774..3e7d4fb 100644
--- a/tests/ImageAvifTest.php
+++ b/tests/ImageAvifTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ImageAvif;
-class ImageAvifTest extends TestCase
+final class ImageAvifTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ImageAvif::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertTrue($this->type->isImage());
}
diff --git a/tests/ImageBmpTest.php b/tests/ImageBmpTest.php
index bbe6ab1..1cbbddd 100644
--- a/tests/ImageBmpTest.php
+++ b/tests/ImageBmpTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ImageBmp;
-class ImageBmpTest extends TestCase
+final class ImageBmpTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ImageBmp::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertTrue($this->type->isImage());
}
diff --git a/tests/ImageGifTest.php b/tests/ImageGifTest.php
index 7fe58ee..19a91e5 100644
--- a/tests/ImageGifTest.php
+++ b/tests/ImageGifTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ImageGif;
-class ImageGifTest extends TestCase
+final class ImageGifTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ImageGif::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertTrue($this->type->isImage());
}
diff --git a/tests/ImageHeicTest.php b/tests/ImageHeicTest.php
index ec065aa..8a0c09b 100644
--- a/tests/ImageHeicTest.php
+++ b/tests/ImageHeicTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ImageHeic;
-class ImageHeicTest extends TestCase
+final class ImageHeicTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ImageHeic::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertTrue($this->type->isImage());
}
diff --git a/tests/ImageHeifTest.php b/tests/ImageHeifTest.php
index 2128ceb..1e96f7d 100644
--- a/tests/ImageHeifTest.php
+++ b/tests/ImageHeifTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ImageHeif;
-class ImageHeifTest extends TestCase
+final class ImageHeifTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ImageHeif::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertTrue($this->type->isImage());
}
diff --git a/tests/ImageIcoTest.php b/tests/ImageIcoTest.php
index be2bf6d..6621e25 100644
--- a/tests/ImageIcoTest.php
+++ b/tests/ImageIcoTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ImageIco;
-class ImageIcoTest extends TestCase
+final class ImageIcoTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ImageIco::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertTrue($this->type->isImage());
}
diff --git a/tests/ImageJpegTest.php b/tests/ImageJpegTest.php
index 56e8f96..ba6601e 100644
--- a/tests/ImageJpegTest.php
+++ b/tests/ImageJpegTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ImageJpeg;
-class ImageJpegTest extends TestCase
+final class ImageJpegTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ImageJpeg::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertTrue($this->type->isImage());
}
diff --git a/tests/ImagePngTest.php b/tests/ImagePngTest.php
index fa8d7b5..518c93b 100644
--- a/tests/ImagePngTest.php
+++ b/tests/ImagePngTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ImagePng;
-class ImagePngTest extends TestCase
+final class ImagePngTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ImagePng::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertTrue($this->type->isImage());
}
diff --git a/tests/ImagePsdTest.php b/tests/ImagePsdTest.php
index 5c7f776..1f666b4 100644
--- a/tests/ImagePsdTest.php
+++ b/tests/ImagePsdTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ImagePsd;
-class ImagePsdTest extends TestCase
+final class ImagePsdTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ImagePsd::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertTrue($this->type->isImage());
}
diff --git a/tests/ImageSvgTest.php b/tests/ImageSvgTest.php
index 69b9fd0..6483020 100644
--- a/tests/ImageSvgTest.php
+++ b/tests/ImageSvgTest.php
@@ -8,7 +8,7 @@
use Intervention\MimeSniffer\Types\TextPlain;
use PHPUnit\Framework\TestCase;
-class ImageSvgTest extends TestCase
+final class ImageSvgTest extends TestCase
{
public $sniffer;
public $type;
@@ -19,23 +19,23 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ImageSvg::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertTrue($this->type->isImage());
}
- public function testPlainXmlIsNotSvg()
+ public function testPlainXmlIsNotSvg(): void
{
$sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.xml');
$this->assertInstanceOf(TextPlain::class, $sniffer->getType());
}
- public function testSvgWithoutXmlTag()
+ public function testSvgWithoutXmlTag(): void
{
$sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/svg');
$this->assertInstanceOf(ImageSvg::class, $sniffer->getType());
diff --git a/tests/ImageTiffTest.php b/tests/ImageTiffTest.php
index 2d8e94f..8a5180a 100644
--- a/tests/ImageTiffTest.php
+++ b/tests/ImageTiffTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ImageTiff;
-class ImageTiffTest extends TestCase
+final class ImageTiffTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ImageTiff::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertTrue($this->type->isImage());
}
diff --git a/tests/ImageWebpTest.php b/tests/ImageWebpTest.php
index ff6d80e..80ee415 100644
--- a/tests/ImageWebpTest.php
+++ b/tests/ImageWebpTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\ImageWebp;
-class ImageWebpTest extends TestCase
+final class ImageWebpTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,12 +17,12 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(ImageWebp::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertTrue($this->type->isImage());
}
diff --git a/tests/MimeSnifferTest.php b/tests/MimeSnifferTest.php
index 0426664..8c78bb4 100644
--- a/tests/MimeSnifferTest.php
+++ b/tests/MimeSnifferTest.php
@@ -11,9 +11,9 @@
use Intervention\MimeSniffer\Types\TextPlain;
use PHPUnit\Framework\TestCase;
-class MimeSnifferTest extends TestCase
+final class MimeSnifferTest extends TestCase
{
- public function testConstructor()
+ public function testConstructor(): void
{
$sniffer = new MimeSniffer('foo');
$this->assertInstanceOf(MimeSniffer::class, $sniffer);
@@ -22,40 +22,40 @@ public function testConstructor()
$this->assertInstanceOf(MimeSniffer::class, $sniffer);
}
- public function testCreateFromString()
+ public function testCreateFromString(): void
{
$sniffer = MimeSniffer::createFromString('foo');
$this->assertInstanceOf(MimeSniffer::class, $sniffer);
}
- public function testCreateFromFilename()
+ public function testCreateFromFilename(): void
{
$sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.jpg');
$this->assertInstanceOf(MimeSniffer::class, $sniffer);
}
- public function testSetFromString()
+ public function testSetFromString(): void
{
$sniffer = new MimeSniffer();
$sniffer = $sniffer->setFromString('foo');
$this->assertInstanceOf(MimeSniffer::class, $sniffer);
}
- public function testSetFromFilename()
+ public function testSetFromFilename(): void
{
$sniffer = new MimeSniffer();
$sniffer = $sniffer->setFromFilename(__DIR__ . '/../tests/stubs/zip');
$this->assertInstanceOf(MimeSniffer::class, $sniffer);
}
- public function testMatchesType()
+ public function testMatchesType(): void
{
$sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.gif');
$this->assertTrue($sniffer->matches(new ImageGif()));
$this->assertFalse($sniffer->matches(new ImageJpeg()));
}
- public function testMatchesArray()
+ public function testMatchesArray(): void
{
$sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.gif');
$this->assertTrue($sniffer->matches([new ImageJpeg(), new ImagePng(), new ImageGif()]));
@@ -64,7 +64,7 @@ public function testMatchesArray()
$this->assertFalse($sniffer->matches([ImageJpeg::class, ImagePng::class]));
}
- public function testMatchesBogus()
+ public function testMatchesBogus(): void
{
$sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/zip');
$this->assertFalse($sniffer->matches('foo'));
diff --git a/tests/VideoMpegTest.php b/tests/VideoMpegTest.php
index 6c6044e..4a14e26 100644
--- a/tests/VideoMpegTest.php
+++ b/tests/VideoMpegTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\VideoMpeg;
-class VideoMpegTest extends TestCase
+final class VideoMpegTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,17 +17,17 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(VideoMpeg::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertFalse($this->type->isImage());
}
- public function testIsVideo()
+ public function testIsVideo(): void
{
$this->assertTrue($this->type->isVideo());
}
diff --git a/tests/VideoXmatroskaTest.php b/tests/VideoXmatroskaTest.php
index 5feaca5..d43e581 100644
--- a/tests/VideoXmatroskaTest.php
+++ b/tests/VideoXmatroskaTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\VideoXmatroska;
-class VideoXmatroskaTest extends TestCase
+final class VideoXmatroskaTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,17 +17,17 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(VideoXmatroska::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertFalse($this->type->isImage());
}
- public function testIsVideo()
+ public function testIsVideo(): void
{
$this->assertTrue($this->type->isVideo());
}
diff --git a/tests/VideoXmsvideoTest.php b/tests/VideoXmsvideoTest.php
index 1e68424..ed8e1da 100644
--- a/tests/VideoXmsvideoTest.php
+++ b/tests/VideoXmsvideoTest.php
@@ -6,7 +6,7 @@
use Intervention\MimeSniffer\MimeSniffer;
use Intervention\MimeSniffer\Types\VideoXmsvideo;
-class VideoXmsvideoTest extends TestCase
+final class VideoXmsvideoTest extends TestCase
{
public $sniffer;
public $type;
@@ -17,17 +17,17 @@ protected function setUp(): void
$this->type = $this->sniffer->getType();
}
- public function testType()
+ public function testType(): void
{
$this->assertInstanceOf(VideoXmsvideo::class, $this->type);
}
- public function testIsImage()
+ public function testIsImage(): void
{
$this->assertFalse($this->type->isImage());
}
- public function testIsVideo()
+ public function testIsVideo(): void
{
$this->assertTrue($this->type->isVideo());
}