OutputWriterTest::testGetOutputWriterWhenNeeded()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
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