FilesystemBootstrapperTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 3 1
A testRegisterBindings() 0 13 1
A setUp() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Framework\Bootstrappers\Filesystem;
6
7
use AbterPhp\Framework\Constant\Env;
8
use AbterPhp\Framework\Environments\Environment;
9
use AbterPhp\Framework\Filesystem\Uploader;
10
use League\Flysystem\Filesystem;
11
use Opulence\Ioc\Container;
12
use PHPUnit\Framework\TestCase;
13
14
class FilesystemBootstrapperTest extends TestCase
15
{
16
    /** @var FilesystemBootstrapper - System Under Test */
17
    protected FilesystemBootstrapper $sut;
18
19
    public function setUp(): void
20
    {
21
        $this->sut = new FilesystemBootstrapper();
22
    }
23
24
    protected function tearDown(): void
25
    {
26
        Environment::unsetVar(Env::DIR_PRIVATE);
27
    }
28
29
    public function testRegisterBindings(): void
30
    {
31
        Environment::setVar(Env::DIR_PRIVATE, '/tmp/bar');
32
33
        $container = new Container();
34
35
        $this->sut->registerBindings($container);
36
37
        $actual = $container->resolve(Filesystem::class);
38
        $this->assertInstanceOf(Filesystem::class, $actual);
39
40
        $actual = $container->resolve(Uploader::class);
41
        $this->assertInstanceOf(Uploader::class, $actual);
42
    }
43
}
44