PropertyOutputTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testWrite() 0 8 1
A testWriteConcat() 0 12 1
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