BuildersBootstrapperTest::testRegisterBindings()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Framework\Bootstrappers\Http\Views;
6
7
use AbterPhp\Framework\Constant\Env;
8
use AbterPhp\Framework\Environments\Environment;
9
use Opulence\Ioc\Container;
10
use Opulence\Views\Factories\IViewFactory;
11
use PHPUnit\Framework\TestCase;
12
13
class BuildersBootstrapperTest extends TestCase
14
{
15
    /** @var BuildersBootstrapper - System Under Test */
16
    protected BuildersBootstrapper $sut;
17
18
    public function setUp(): void
19
    {
20
        Environment::unsetVar(Env::ENV_NAME);
21
22
        $this->sut = new BuildersBootstrapper();
23
    }
24
25
    public function testRegisterBindings(): void
26
    {
27
        Environment::setVar(Env::ENV_NAME, 'foo');
28
29
        $viewFactoryMock = $this->getMockBuilder(IViewFactory::class)->getMock();
30
        $viewFactoryMock->expects($this->once())->method('registerBuilder');
31
32
        $container = new Container();
33
        $container->bindInstance(IViewFactory::class, $viewFactoryMock);
34
35
        $this->sut->registerBindings($container);
36
    }
37
}
38