Passed
Push — main ( 3b40c1...b711d3 )
by Peter
07:24
created

FilesystemBootstrapperTest::tearDown()   A

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