for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Velikonja\LabbyBundle\Test\Command;
use Symfony\Component\Console\Output\OutputInterface;
use Velikonja\LabbyBundle\Command\SyncDBCommand;
class SyncDbCommandTest extends CommandTestCase
{
/**
* Test simple execute of dump command.
*/
public function testExecute()
$exitCode = $this->tester->run(
array(
'command' => SyncDbCommand::COMMAND_NAME
),
'verbosity' => OutputInterface::VERBOSITY_DEBUG
)
);
$display = trim($this->tester->getDisplay());
$this->assertEquals(0, $exitCode, $display);
$this->assertRegExp(
'/Finished in [0-9\.]+ seconds!/',
$display,
'Wrong output of sync:db command detected.'
}
* Test first drops test database and then runs basic execute to check if db_recreate works.
public function testExecuteWithoutExistingDatabase()
$this->dropTestDB();
$this->testExecute();