Skip to content

cgauge/laravel-s3-minio

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

Laravel S3 Minio 📁

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

About

Fake S3 storage for running test code

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages