OutputWriterTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testGetOutputWriterWhenNeeded() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Zenify\DoctrineMigrations\Tests;
6
7
use PHPUnit\Framework\TestCase;
8
use PHPUnit_Framework_Assert;
9
use Symfony\Component\Console\Output\ConsoleOutput;
10
use Zenify\DoctrineMigrations\OutputWriter;
11
12
13
final class OutputWriterTest extends TestCase
14
{
15
16
	/**
17
	 * @var OutputWriter
18
	 */
19
	private $outputWriter;
20
21
22
	protected function setUp()
23
	{
24
		$this->outputWriter = new OutputWriter;
25
	}
26
27
28
	public function testGetOutputWriterWhenNeeded()
29
	{
30
		$consoleOutput = PHPUnit_Framework_Assert::getObjectAttribute($this->outputWriter, 'consoleOutput');
31
		$this->assertNull($consoleOutput);
32
33
		$this->outputWriter->write('');
34
35
		$consoleOutput = PHPUnit_Framework_Assert::getObjectAttribute($this->outputWriter, 'consoleOutput');
36
		$this->assertInstanceOf(ConsoleOutput::class, $consoleOutput);
37
	}
38
39
}
40