[Nostromo] Add tests

This commit is contained in:
Andrés Montañez
2017-01-01 01:28:58 -03:00
parent 74c60f55ef
commit 196f84ceb1
16 changed files with 1957 additions and 17 deletions
@@ -0,0 +1,30 @@
<?php
namespace Mage\Tests\Command\BuiltIn;
use Mage\Command\BuiltIn\VersionCommand;
use Mage\Command\AbstractCommand;
use Mage\Tests\MageTestApplication;
use Mage\Tests\Runtime\RuntimeMockup;
use Mage\Mage;
use Symfony\Component\Console\Tester\CommandTester;
use PHPUnit\Framework\TestCase;
class VersionCommandTest extends TestCase
{
public function testVersionOutput()
{
$application = new MageTestApplication();
$application->add(new VersionCommand());
/** @var AbstractCommand $command */
$command = $application->find('version');
$command->setRuntime(new RuntimeMockup());
$tester = new CommandTester($command);
$tester->execute(['command' => $command->getName()]);
$output = trim($tester->getDisplay());
$this->assertEquals(sprintf('Magallanes v%s [%s]', Mage::VERSION, Mage::CODENAME), $output);
}
}