-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the Filesystem manager's exception on unsupported driver
- Loading branch information
1 parent
91553d8
commit 9a3e6a9
Showing
2 changed files
with
28 additions
and
4 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,23 @@ | ||
<?php | ||
|
||
namespace Illuminate\Tests\Filesystem; | ||
|
||
use Illuminate\Filesystem\FilesystemManager; | ||
use Illuminate\Foundation\Application; | ||
use InvalidArgumentException; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class FilesystemManagerTest extends TestCase | ||
{ | ||
public function testExceptionThrownOnUnsupportedDriver() | ||
{ | ||
$this->expectException(InvalidArgumentException::class); | ||
$this->expectExceptionMessage('Driver [unsupported-disk] is not supported.'); | ||
|
||
$filesystem = new FilesystemManager(tap(new Application, function ($app) { | ||
$app['config'] = ['filesystems.disks.unsupported-disk' => null]; | ||
})); | ||
|
||
$filesystem->disk('unsupported-disk'); | ||
} | ||
} |