Completed
Push — master ( 2704f9...f273e8 )
by Tomáš
02:19
created

SetConsoleOutputEventSubscriberTest.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Zenify\DoctrineMigrations\Tests\EventSubscriber;
4
5
use PHPUnit_Framework_Assert;
6
use PHPUnit_Framework_TestCase;
7
use Symfony\Component\Console\Application;
8
use Symfony\Component\Console\Input\ArrayInput;
9
use Symfony\Component\Console\Output\BufferedOutput;
10
use Symfony\Component\Console\Output\OutputInterface;
11
use Zenify\DoctrineMigrations\OutputWriter;
12
use Zenify\DoctrineMigrations\Tests\ContainerFactory;
0 ignored issues
show
As per PSR2, there should be exactly one blank line after the last USE statement, 2 were found though.
Loading history...
13
14
15
final class SetConsoleOutputEventSubscriberTest extends PHPUnit_Framework_TestCase
16
{
17
18
	/**
19
	 * @var Application
20
	 */
21
	private $application;
22
23
	/**
24
	 * @var OutputWriter
25
	 */
26
	private $outputWriter;
27
28
29
	protected function setUp()
30
	{
31
		$container = (new ContainerFactory)->create();
32
		$this->application = $container->getByType(Application::class);
33
		$this->outputWriter = $container->getByType(OutputWriter::class);
34
	}
35
36
37
	public function testDispatching()
38
	{
39
		$this->assertNull(
40
			PHPUnit_Framework_Assert::getObjectAttribute($this->outputWriter, 'consoleOutput')
41
		);
42
43
		$input = new ArrayInput(['command' => 'migrations:status']);
44
		$output = new BufferedOutput;
45
		$this->application->run($input, $output);
46
47
		$this->assertInstanceOf(
48
			OutputInterface::class,
49
			PHPUnit_Framework_Assert::getObjectAttribute($this->outputWriter, 'consoleOutput')
50
		);
51
	}
52
53
}
1 ignored issue
show
According to PSR2, the closing brace of classes should be placed on the next line directly after the body.

Below you find some examples:

// Incorrect placement according to PSR2
class MyClass
{
    public function foo()
    {

    }
    // This blank line is not allowed.

}

// Correct
class MyClass
{
    public function foo()
    {

    } // No blank lines after this line.
}
Loading history...
54