ManualUsageTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
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 Symfony\Component\Console\Application;
9
use Symfony\Component\Console\Input\ArrayInput;
10
use Symfony\Component\Console\Output\BufferedOutput;
11
12
13
final class ManualUsageTest extends TestCase
14
{
15
16
	/**
17
	 * @var Application
18
	 */
19
	private $consoleApplication;
20
21
22
	protected function setUp()
23
	{
24
		$container = (new ContainerFactory)->createWithConfig(__DIR__ . '/config/manualUsage.neon');
25
		$this->consoleApplication = $container->getByType(Application::class);
26
	}
27
28
29 View Code Duplication
	public function testStatus()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
	{
31
		$input = new ArrayInput(['command' => 'migrations:status']);
32
		$output = new BufferedOutput;
33
34
		$status = $this->consoleApplication->run($input, $output);
35
36
		$this->assertSame(0, $status);
37
		$this->assertContains('Configuration', $output->fetch());
38
	}
39
40
41 View Code Duplication
	public function testMigrate()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
42
	{
43
		$input = new ArrayInput(['command' => 'migrations:migrate']);
44
		$input->setInteractive(FALSE);
45
46
		$output = new BufferedOutput;
47
48
		$status = $this->consoleApplication->run($input, $output);
49
		$this->assertSame(0, $status);
50
	}
51
52
}
53