diff --git a/src/AssetService.php b/src/AssetService.php index f467b06..b9c5c01 100644 --- a/src/AssetService.php +++ b/src/AssetService.php @@ -119,5 +119,7 @@ protected function getType($path) if (isset($this->types[$ext])) { return $this->types[$ext]; } + + return 'application/octet-stream'; } } diff --git a/tests/src/AssetServiceTest.php b/tests/src/AssetServiceTest.php index 51060dc..6c8b914 100644 --- a/tests/src/AssetServiceTest.php +++ b/tests/src/AssetServiceTest.php @@ -31,7 +31,7 @@ public function testGetAsset_noVendorPackage() { $asset = $this->service->getAsset('no-vendor', 'no-package', 'style.css'); $this->assertNull($asset->path); - $this->assertNull($asset->type); + $this->assertEquals('application/octet-stream', $asset->type); } public function testGetAsset_noType() @@ -41,6 +41,6 @@ public function testGetAsset_noType() $expect = $this->asset_dir . DIRECTORY_SEPARATOR . 'fake.txt'; $this->assertSame($expect, $asset->path); - $this->assertNull($asset->type); + $this->assertEquals('application/octet-stream', $asset->type); } }