Completed
Push — master ( 2f04be...9682f1 )
by Steevan
01:49 queued 18s
created

DumpTest::testTestOutput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Steevanb\PhpBacktrace\Tests\DebugBacktraceConsole;
4
5
use PHPUnit\Framework\TestCase;
6
use Steevanb\PhpBacktrace\Tests\Classes\TestOutput;
7
8
class DumpTest extends TestCase
9
{
10
    protected static function assertOutput(TestOutput $output)
11
    {
12
        static::assertInternalType('string', $output->getOutput());
13
        static::assertInternalType('int', strpos($output->getOutput(), '|<info> line </info>|'));
14
    }
15
16
    public function testTestOutput()
17
    {
18
        $output = new TestOutput();
19
        \DebugBacktraceConsole::dump($output);
20
21
        static::assertOutput($output);
22
    }
23
24
    public function testOffset1()
25
    {
26
        $output = new TestOutput();
27
        \DebugBacktraceConsole::dump($output, 1);
28
29
        static::assertOutput($output);
30
    }
31
32
    public function testLimit2()
33
    {
34
        $output = new TestOutput();
35
        \DebugBacktraceConsole::dump($output, 0, 2);
36
37
        static::assertOutput($output);
38
    }
39
40
    public function testNoGivenOutput()
41
    {
42
        // I don't know if we can get ConsoleOutput writed lines as it's not writed with echo so ob_x does no work?
43
        \DebugBacktraceConsole::dump();
44
    }
45
}
46