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

DebugServiceProviderTest::test_registerDebug()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
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