Skip to content
This repository was archived by the owner on Aug 9, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/AwsS3Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ public function getBucket()
return $this->bucket;
}

/**
* Set the S3Client bucket. Used for overriding the default bucket.
*
* @param string $bucket
*/
public function setBucket($bucket)
{
$this->bucket = $bucket;
}

/**
* Get the S3Client instance.
*
Expand Down
10 changes: 10 additions & 0 deletions tests/AwsS3AdapterTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ public function testGetBucket()
$this->assertEquals('bucket', $adapter->getBucket());
}

public function testSetBucket()
{
$mock = $this->getS3Client();
$adapter = new Adapter($mock, 'bucket');
$this->assertEquals('bucket', $adapter->getBucket());

$adapter->setBucket('newBucket');
$this->assertEquals('newBucket', $adapter->getBucket());
}

public function testGetClient()
{
$mock = $this->getS3Client();
Expand Down