BuildersBootstrapperTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 23
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testRegisterBindings() 0 11 1
A setUp() 0 5 1
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