Most of the time when I'm writing test code in Laravel I take advantage of the great Storage::fake() provided by Laravel Test Suite. Here's how simple it is for me to write test code with it.
My Test Code will look like this: $minio = new Minio(); $minio->disk('my-bucket', function (S3Client $client, string $bucket) { $this->post('/my/endpoint/that/interacts/with/s3', []) ->assertSuccessful(); $object = $client->getObject([ 'Bucket' => $bucket, 'Key' => "/my/expected/s3/key"]); $content = $object['Body']->getContents(); $this->assertStringContainsString('partial-file-content', $content); }); When instantiating the Minio class, I have the opportunity to overwrite some defaults.