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

SecretGeneratorBootstrapperTest::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\Console\Commands\Security;
4
5
use AbterPhp\Framework\Console\Commands\Security\SecretGenerator;
6
use Opulence\Events\Dispatchers\IEventDispatcher;
7
use Opulence\Ioc\Container;
8
use PHPUnit\Framework\TestCase;
9
10
class SecretGeneratorBootstrapperTest extends TestCase
11
{
12
    /** @var SecretGeneratorBootstrapper */
13
    protected SecretGeneratorBootstrapper $sut;
14
15
    public function setUp(): void
16
    {
17
        $this->sut = new SecretGeneratorBootstrapper();
18
    }
19
20
    public function testRegisterBindings()
21
    {
22
        $eventDispatchedMock = $this->getMockBuilder(IEventDispatcher::class)->getMock();
23
        $eventDispatchedMock->expects($this->once())->method('dispatch');
24
25
        $container = new Container();
26
        $container->bindInstance(IEventDispatcher::class, $eventDispatchedMock);
27
28
        $this->sut->registerBindings($container);
29
30
        $actual = $container->resolve(SecretGenerator::class);
31
        $this->assertInstanceOf(SecretGenerator::class, $actual);
32
    }
33
}
34