Passed
Branch stable (668427)
by Nuno
04:13 queued 01:26
created

WriterTest::it_sets_the_output()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Tests\Unit;
4
5
use PHPUnit\Framework\TestCase;
6
use NunoMaduro\Collision\Writer;
7
use Symfony\Component\Console\Output\ConsoleOutput;
8
use NunoMaduro\Collision\Contracts\Writer as WriterContract;
9
10
class WriterTest extends TestCase
11
{
12
    /** @test */
13
    public function it_respects_is_contract(): void
14
    {
15
        $this->assertInstanceOf(WriterContract::class, new Writer());
16
    }
17
18
    /** @test */
19
    public function it_gets_the_output(): void
20
    {
21
        $writer = new Writer($output = new ConsoleOutput());
22
23
        $this->assertEquals($writer->getOutput(), $output);
24
    }
25
26
    /** @test */
27
    public function it_sets_the_output(): void
28
    {
29
        $writer = (new Writer())->setOutput($output = new ConsoleOutput());
30
31
        $this->assertEquals($writer->getOutput(), $output);
32
    }
33
}
34