FilesystemS3AdapterPluginTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 23
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testPlugin() 0 21 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 *  This file is part of the Micro framework package.
7
 *
8
 *  (c) Stanislau Komar <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace Micro\Plugin\Filesystem\Adapter\Aws\Test\Unit;
15
16
use League\Flysystem\FilesystemOperator;
17
use Micro\Kernel\App\AppKernel;
18
use Micro\Plugin\Filesystem\Adapter\Aws\FilesystemS3AdapterPlugin;
19
use Micro\Plugin\Filesystem\Facade\FilesystemFacadeInterface;
20
use PHPUnit\Framework\TestCase;
21
22
class FilesystemS3AdapterPluginTest extends TestCase
23
{
24
    public function testPlugin()
25
    {
26
        $kernel = new AppKernel(
27
            [
28
                'MICRO_FS_DEFAULT_TYPE' => 'aws_s3',
29
                'MICRO_FS_DEFAULT_KEY_ACCESS' => 'access-key',
30
                'MICRO_FS_DEFAULT_KEY_SECRET' => 'secret-key',
31
                'MICRO_FS_DEFAULT_REGION' => 'us-west',
32
                'MICRO_FS_DEFAULT_BUCKET' => 'test-bucket',
33
            ],
34
            [
35
                FilesystemS3AdapterPlugin::class,
36
            ]
37
        );
38
39
        $kernel->run();
40
        /** @var FilesystemFacadeInterface $facade */
41
        $facade = $kernel->container()->get(FilesystemFacadeInterface::class);
42
        $operator = $facade->createFsOperator('default');
43
44
        $this->assertInstanceOf(FilesystemOperator::class, $operator);
45
    }
46
}
47