customergauge / minio
Faking S3 storage with Minio
Installs: 16 905
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 5
Forks: 0
Open Issues: 0
Requires
- php: >=7.3
- ext-json: *
- aws/aws-sdk-php: ^3.158
- illuminate/contracts: >=7.1
Requires (Dev)
- illuminate/config: >=7.1
- illuminate/container: ~7.1
- phpstan/phpstan: ^1.0
- phpunit/phpunit: >=9.0
README
This library provides a convenient way to write test code that runs against Minio, an S3 compatible storage.
Installation
composer require customergauge/minio
Usage
$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); });
Docker Example
minio: image: minio/minio ports: - 9000:9000 environment: - MINIO_ACCESS_KEY=customergauge - MINIO_SECRET_KEY=phpunit123 command: server /data