AwsS3v3Factory example

use PHPUnit\Framework\TestCase;
use Shopware\Core\Framework\Adapter\Filesystem\Adapter\AwsS3v3Factory;
use Shopware\Core\Framework\Adapter\Filesystem\Adapter\DecoratedAsyncS3Adapter;

/** * @internal */
class AwsFactoryTest extends TestCase
{
    public function testFactory(): void
    {
        $factory = new AwsS3v3Factory();
        static::assertSame('amazon-s3', $factory->getType());

        $adapter = $factory->create([
            'bucket' => 'test',
            'region' => 'test',
            'endpoint' => 'http://localhost',
            'use_path_style_endpoint' => true,
            'credentials' => [
                'key' => 'test',
                'secret' => 'test',
            ],
        ]);
use Shopware\Core\Framework\Adapter\Filesystem\Adapter\DecoratedAsyncS3Adapter;

/** * @internal * * @covers \Shopware\Core\Framework\Adapter\Filesystem\Adapter\AwsS3v3Factory */
class AwsS3v3FactoryTest extends TestCase
{
    public function testGetType(): void
    {
        static::assertEquals('amazon-s3', (new AwsS3v3Factory())->getType());
    }

    public function testCreate(): void
    {
        $config = [
            'bucket' => 'private',
            'endpoint' => 'http://localhost:9000',
            'use_path_style_endpoint' => true,
            'region' => 'local',
            'root' => 'foobar',
            'credentials' => [
                
Home | Imprint | This part of the site doesn't use cookies.