1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
<?php
declare(strict_types=1);
namespace AsyncAws\Core\Tests\Integration;
use AsyncAws\Core\Credentials\NullProvider;
use AsyncAws\S3\S3Client;
use PHPUnit\Framework\TestCase;
class ClientTest extends TestCase
{
public function testStreamToStream(): void
{
if (!class_exists(S3Client::class)) {
self::markTestSkipped('This test needs a client with waiter endpoints');
}
$client = new S3Client([
'endpoint' => 'http://localhost:4569',
'pathStyleEndpoint' => true,
], new NullProvider());
$client->createBucket(['Bucket' => 'foo'])->resolve();
$client->putObject([
'Bucket' => 'foo',
'Key' => 'bar',
'Body' => 'content',
])->resolve();
$client->putObject([
'Bucket' => 'foo',
'Key' => 'bar2',
'Body' => $client->getObject(['Bucket' => 'foo', 'Key' => 'bar'])->getBody()->getContentAsResource(),
])->resolve();
self::expectNotToPerformAssertions();
}
}
|