testCreateFsOperator()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 15
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 23
rs 9.7666
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\Local\Test\Unit\Decorator;
15
16
use League\Flysystem\FilesystemOperator;
17
use Micro\Plugin\Filesystem\Adapter\Local\Configuration\FilesystemLocalAdapterPluginConfigurationInterface;
18
use Micro\Plugin\Filesystem\Adapter\Local\Decorator\LocalFilesystemFacadeDecorator;
19
use Micro\Plugin\Filesystem\Business\FS\FsFactoryInterface;
20
use Micro\Plugin\Filesystem\Facade\FilesystemFacadeInterface;
21
use PHPUnit\Framework\TestCase;
22
23
class LocalFilesystemFacadeDecoratorTest extends TestCase
24
{
25
    public function testCreateFsOperator()
26
    {
27
        $fsOperator = $this->createMock(FilesystemOperator::class);
28
29
        $decorated = $this->createMock(FilesystemFacadeInterface::class);
30
        $decorated
31
            ->expects($this->once())
32
            ->method('createFsOperator')
33
            ->with('test')
34
            ->willReturn($fsOperator);
35
36
        $fsFactory = $this->createMock(FsFactoryInterface::class);
37
        $fsFactory->expects($this->never())->method('create');
38
39
        $cfg = $this->createMock(FilesystemLocalAdapterPluginConfigurationInterface::class);
40
41
        $decorator = new LocalFilesystemFacadeDecorator(
42
            $decorated,
43
            $fsFactory,
44
            $cfg
45
        );
46
47
        $this->assertEquals($fsOperator, $decorator->createFsOperator('test'));
48
    }
49
}
50