GenerateCommandTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

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 8
nc 1
nop 0
1
<?php
2
3
namespace Reddogs\Doctrine\Migrations;
4
5
use ZF\Console\Route;
6
7
class GenerateCommandTest extends \PHPUnit_Framework_TestCase
8
{
9
    private $command, $route;
0 ignored issues
show
Coding Style introduced by
It is generally advisable to only define one property per statement.

Only declaring a single property per statement allows you to later on add doc comments more easily.

It is also recommended by PSR2, so it is a common style that many people expect.

Loading history...
10
11
    protected function setUp()
12
    {
13
        $this->command = $this->getMockBuilder(GenerateCommand::class)
14
                              ->disableOriginalConstructor()
15
                              ->setMethods(['null'])
16
                              ->getMock();
17
        $moduleConfig = (new ModuleConfig())->__invoke();
18
        $migrateParams = $moduleConfig['console_routes']['mogrations:generate'];
19
        $this->route = new Route($migrateParams['name'], $migrateParams['route']);
20
    }
21
22
    public function testGetInputCommand()
23
    {
24
        $this->assertSame('migrations:generate', $this->command->getInputCommand($this->route));
25
    }
26
27
    public function testGetInputCommandWithParams()
28
    {
29
        $this->route->match(['mogrations:generate', 'testModuleName', '-q', '-n', '-v']);
30
        $this->assertEquals('migrations:generate -q -n -v', $this->command->getInputCommand($this->route));
31
    }
32
}