Passed
Push — main ( 9c59f2...5fac80 )
by Peter
02:52
created

NavigationBootstrapperTest::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\Navigation;
4
5
use AbterPhp\Framework\Constant\Navigation as NavConstant;
6
use AbterPhp\Framework\I18n\ITranslator;
7
use AbterPhp\Framework\Navigation\Navigation;
8
use Opulence\Events\Dispatchers\IEventDispatcher;
9
use Opulence\Ioc\Container;
10
use PHPUnit\Framework\TestCase;
11
12
class NavigationBootstrapperTest extends TestCase
13
{
14
    /** @var NavigationBootstrapper */
15
    protected NavigationBootstrapper $sut;
16
17
    public function setUp(): void
18
    {
19
        $this->sut = new NavigationBootstrapper();
20
    }
21
22
    public function testRegisterBindings()
23
    {
24
        $translatorMock      = $this->getMockBuilder(ITranslator::class)->getMock();
25
        $eventDispatcherMock = $this->getMockBuilder(IEventDispatcher::class)->getMock();
26
27
        $container = new Container();
28
        $container->bindInstance(ITranslator::class, $translatorMock);
29
        $container->bindInstance(IEventDispatcher::class, $eventDispatcherMock);
30
31
        $this->sut->registerBindings($container);
32
33
        $actual = $container->resolve(NavConstant::NAVBAR);
34
        $this->assertInstanceOf(Navigation::class, $actual);
35
36
        $actual = $container->resolve(NavConstant::PRIMARY);
37
        $this->assertInstanceOf(Navigation::class, $actual);
38
    }
39
}
40