Test Setup Failed
Push — master ( c4d24d...9082b2 )
by Gabriel
13:27
created

DebugServiceProviderTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

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);
0 ignored issues
show
Bug introduced by
The method assertInstanceOf() does not seem to exist on object<Nip\Debug\Tests\DebugServiceProviderTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
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);
0 ignored issues
show
Bug introduced by
The method assertInstanceOf() does not seem to exist on object<Nip\Debug\Tests\DebugServiceProviderTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
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