Passed
Push — stable ( 1cb707...85bde5 )
by Nuno
01:47
created

WriterTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 22
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A it_sets_the_output() 0 5 1
A it_respects_is_contract() 0 3 1
A it_gets_the_output() 0 5 1
1
<?php
2
3
namespace Tests\Unit;
4
5
use PHPUnit\Framework\TestCase;
6
use Whoops\Exception\Inspector;
7
use NunoMaduro\Collision\Writer;
8
use Whoops\Exception\FrameCollection;
9
use Symfony\Component\Console\Output\ConsoleOutput;
10
use Symfony\Component\Console\Output\BufferedOutput;
11
use NunoMaduro\Collision\Contracts\Writer as WriterContract;
12
13
class WriterTest extends TestCase
14
{
15
    /** @test */
16
    public function it_respects_is_contract(): void
17
    {
18
        $this->assertInstanceOf(WriterContract::class, new Writer());
19
    }
20
21
    /** @test */
22
    public function it_gets_the_output(): void
23
    {
24
        $writer = new Writer($output = new ConsoleOutput());
25
26
        $this->assertEquals($writer->getOutput(), $output);
27
    }
28
29
    /** @test */
30
    public function it_sets_the_output(): void
31
    {
32
        $writer = (new Writer())->setOutput($output = new ConsoleOutput());
33
34
        $this->assertEquals($writer->getOutput(), $output);
35
    }
36
}