Storage::fake('public) throwing error "Too few arguments"
According to the title, when I try to use Storage::fake('public'), it shows an error for passing two arguments, unfortunately.
Error:
There was 1 error:
1) Tests\Integration\Services\Feeds\StorageTest::it_checks_files_in_fake_storage
ArgumentCountError: Too few arguments to function Illuminate\Filesystem\FilesystemManager::createLocalDriver(), 1 passed in /var/www/application/web/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 358 and exactly 2 expected
My code:
namespace Tests\Integration\Services\Feeds;
use Tests\TestCase;
use Illuminate\Support\Facades\Storage;
class StorageTest extends TestCase
{
public function setUp(): void
{
parent::setUp();
}
/** @test */
public function it_checks_files_in_fake_storage(): void
{
Storage::fake('public');
Storage::delete('public/uploads/users/default-avatar.jpg');
Storage::disk('public')->assertMissing('uploads/users/default-avatar.jpg');
}
}
I haven't changed any configuration related to filesystems. I am using the default configuration from the Laravel installation. Any thoughts on how I could tackle this issue?
you can try explicitly passing a second argument which is an empty array. But this is just to bypass the issue, an update of the framework should fix it too I think, I tried on 11.8.0 all good.