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

BuildersBootstrapperTest::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\Http\Views;
4
5
use AbterPhp\Framework\Constant\Env;
6
use AbterPhp\Framework\Environments\Environment;
7
use Opulence\Ioc\Container;
8
use Opulence\Views\Factories\IViewFactory;
9
use PHPUnit\Framework\TestCase;
10
11
class BuildersBootstrapperTest extends TestCase
12
{
13
    /** @var BuildersBootstrapper */
14
    protected BuildersBootstrapper $sut;
15
16
    public function setUp(): void
17
    {
18
        $this->sut = new BuildersBootstrapper();
19
    }
20
21
    protected function tearDown(): void
22
    {
23
        Environment::unsetVar(Env::ENV_NAME);
24
    }
25
26
    public function testRegisterBindings()
27
    {
28
        Environment::setVar(Env::ENV_NAME, 'foo');
29
30
        $viewFactoryMock = $this->getMockBuilder(IViewFactory::class)->getMock();
31
        $viewFactoryMock->expects($this->once())->method('registerBuilder');
32
33
        $container = new Container();
34
        $container->bindInstance(IViewFactory::class, $viewFactoryMock);
35
36
        $this->sut->registerBindings($container);
37
    }
38
}
39