FilesystemBootstrapperTest::tearDown()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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