DebugServiceProviderTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 32
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A test_registerDebug() 0 8 1
A test_registerErrorHandler() 0 8 1
A initServiceProvider() 0 8 1
1
<?php
2
3
namespace Nip\Debug\Tests;
4
5
use Nip\Debug\Debug;
6
use Nip\Debug\DebugServiceProvider;
7
use Nip\Debug\ErrorHandler;
8
9
/**
10
 * Class DebugServiceProviderTest
11
 * @package Nip\Debug\Tests
12
 */
13
class DebugServiceProviderTest extends AbstractTest
14
{
15
    public function test_registerDebug()
16
    {
17
        $provider = $this->initServiceProvider();
18
        $container = $provider->getContainer();
19
20
        $debug = $container->get('debug');
21
        self::assertInstanceOf(Debug::class, $debug);
22
    }
23
24
    public function test_registerErrorHandler()
25
    {
26
        $provider = $this->initServiceProvider();
27
        $container = $provider->getContainer();
28
29
        $debug = $container->get('error-handler');
30
        self::assertInstanceOf(ErrorHandler::class, $debug);
31
    }
32
33
    /**
34
     * @return DebugServiceProvider
35
     */
36
    protected function initServiceProvider()
37
    {
38
        $provider = new DebugServiceProvider();
39
        $provider->initContainer();
40
        $provider->register();
41
42
        return $provider;
43
    }
44
}
45