EventServiceProviderTest::testRegister()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 7
rs 10
c 1
b 0
f 1
1
<?php
2
3
namespace ByTIC\EventDispatcher\Tests;
4
5
use ByTIC\EventDispatcher\EventServiceProvider;
6
use Nip\Container\Container;
7
8
/**
9
 * Class EventServiceProviderTest
10
 * @package ByTIC\EventDispatcher\Tests
11
 */
12
class EventServiceProviderTest extends AbstractTest
13
{
14
    protected $provider;
15
16
    public function testRegister()
17
    {
18
        self::assertFalse($this->provider->getContainer()->has('events'));
19
20
        $this->provider->register();
21
22
        self::assertTrue($this->provider->getContainer()->has('events'));
23
    }
24
25
    protected function setUp(): void
26
    {
27
        parent::setUp();
28
29
        $container = new Container();
30
        Container::setInstance($container);
31
32
        $this->provider = new EventServiceProvider();
33
        $this->provider->setContainer($container);
34
    }
35
}
36