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

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