Skip to content

Commit

Permalink
Revert "[10.x] league/flysystem 3.22.0 now prefer inclusive mime-ty…
Browse files Browse the repository at this point in the history
…pe instead of `null`. (#49229)" (#49235)

This reverts commit 0947618.
  • Loading branch information
driesvints authored Dec 4, 2023
1 parent 0947618 commit be526ee
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions tests/Filesystem/FilesystemAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Illuminate\Tests\Filesystem;

use Carbon\Carbon;
use Composer\InstalledVersions;
use GuzzleHttp\Psr7\Stream;
use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Filesystem\FilesystemManager;
Expand Down Expand Up @@ -199,19 +198,9 @@ public function testJsonReturnsNullIfJsonDataIsInvalid()
$this->assertNull($filesystemAdapter->json('file.json'));
}

public function testMimeTypeDetectedPreferInclusiveMimeTypeOverNullAsEmpty()
{
if (version_compare(InstalledVersions::getPrettyVersion('league/flysystem'), '3.22.0', '<')) {
$this->markTestSkipped('Require league/flysystem 3.22.0');
}

$this->filesystem->write('unknown.mime-type', '');
$filesystemAdapter = new FilesystemAdapter($this->filesystem, $this->adapter);
$this->assertSame('application/x-empty', $filesystemAdapter->mimeType('unknown.mime-type'));
}

public function testMimeTypeNotDetected()
{
$this->filesystem->write('unknown.mime-type', '');
$filesystemAdapter = new FilesystemAdapter($this->filesystem, $this->adapter);
$this->assertFalse($filesystemAdapter->mimeType('unknown.mime-type'));
}
Expand Down Expand Up @@ -542,6 +531,8 @@ public function testThrowExceptionsForPut()

public function testThrowExceptionsForMimeType()
{
$this->filesystem->write('unknown.mime-type', '');

$adapter = new FilesystemAdapter($this->filesystem, $this->adapter, ['throw' => true]);

try {
Expand Down

0 comments on commit be526ee

Please sign in to comment.