Completed
Push — master ( d129c8...00172d )
by Gabriel
03:56
created

HandlerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
c 0
b 0
f 0
dl 0
loc 30
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testIsDebug() 0 10 1
A dataIsDebug() 0 10 1
1
<?php
2
3
namespace Nip\Http\Tests\Exceptions;
4
5
use Nip\Config\Config;
6
use Nip\Container\Container;
7
use Nip\Http\Tests\AbstractTest;
8
use Nip\Http\Exceptions\Handler;
9
10
/**
11
 * Class HandlerTest
12
 * @package Nip\Http\Tests\Exceptions
13
 */
14
class HandlerTest extends AbstractTest
15
{
16
    /**
17
     * @dataProvider dataIsDebug
18
     */
19
    public function testIsDebug($value, $debug)
20
    {
21
        $container = new Container();
22
        Container::setInstance($container);
23
24
        $config = new Config(['app' => ['debug' => $value]]);
25
        $container->set('config', $config);
26
27
        $handler = new Handler($container);
28
        self::assertSame($debug, $handler->isDebug());
29
    }
30
31
    /**
32
     * @return array
33
     */
34
    public function dataIsDebug()
35
    {
36
        return [
37
            ['', false],
38
            ['false', false],
39
            [false, false],
40
            [0, false],
41
            [1, true],
42
            ['true', true],
43
            [true, true],
44
        ];
45
    }
46
}
47
48