PropertyOutputTest::testWrite()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineModuleTest\Component\Console\Output;
6
7
use DoctrineModule\Component\Console\Output\PropertyOutput;
8
use PHPUnit\Framework\TestCase;
9
use const PHP_EOL;
10
11
/**
12
 * Tests for {@see \DoctrineModule\Component\Console\Output\PropertyOutput}
13
 */
14
class PropertyOutputTest extends TestCase
15
{
16
    /**
17
     * @covers \DoctrineModule\Component\Console\Output\PropertyOutput
18
     */
19
    public function testWrite() : void
20
    {
21
        $message = 'message';
22
23
        $output = new PropertyOutput();
24
        $output->write($message);
25
        $this->assertEquals($message, $output->getMessage());
26
    }
27
28
    /**
29
     * @covers \DoctrineModule\Component\Console\Output\PropertyOutput
30
     */
31
    public function testWriteConcat() : void
32
    {
33
        $message  = 'message';
34
        $message2 = 'message2';
35
36
        $output = new PropertyOutput();
37
        $output->write($message, true);
38
        $output->write($message2, true);
39
40
        $expected = $message . PHP_EOL . $message2 . PHP_EOL;
41
        $this->assertEquals($expected, $output->getMessage());
42
    }
43
}
44