DumpTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 35
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A assertDump() 0 5 1
A testDump() 0 8 1
A testOffset1() 0 8 1
A testLimit2() 0 8 1
1
<?php
2
3
namespace Steevanb\PhpBacktrace\Tests\DebugBacktraceHtml;
4
5
use PHPUnit\Framework\TestCase;
6
7
class DumpTest extends TestCase
8
{
9
    protected static function assertDump($dump)
10
    {
11
        static::assertInternalType('string', $dump);
12
        static::assertInternalType('int', strpos($dump, '<div class="steevanb-backtrace-container">'));
13
    }
14
15
    public function testDump()
16
    {
17
        ob_start();
18
        \DebugBacktraceHtml::dump();
19
        $dump = ob_get_contents();
20
21
        static::assertDump($dump);
22
    }
23
24
    public function testOffset1()
25
    {
26
        ob_start();
27
        \DebugBacktraceHtml::dump(1);
28
        $dump = ob_get_contents();
29
30
        static::assertDump($dump);
31
    }
32
33
    public function testLimit2()
34
    {
35
        ob_start();
36
        \DebugBacktraceHtml::dump(0, 2);
37
        $dump = ob_get_contents();
38
39
        static::assertDump($dump);
40
    }
41
}
42