for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Reddogs\Doctrine\Migrations;
use ZF\Console\Route;
class GenerateCommandTest extends \PHPUnit_Framework_TestCase
{
private $command, $route;
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.
protected function setUp()
$this->command = $this->getMockBuilder(GenerateCommand::class)
->disableOriginalConstructor()
->setMethods(['null'])
->getMock();
$moduleConfig = (new ModuleConfig())->__invoke();
$migrateParams = $moduleConfig['console_routes']['mogrations:generate'];
$this->route = new Route($migrateParams['name'], $migrateParams['route']);
}
public function testGetInputCommand()
$this->assertSame('migrations:generate', $this->command->getInputCommand($this->route));
public function testGetInputCommandWithParams()
$this->route->match(['mogrations:generate', 'testModuleName', '-q', '-n', '-v']);
$this->assertEquals('migrations:generate -q -n -v', $this->command->getInputCommand($this->route));
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.