mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-09 14:58:57 +02:00
[Nostromo] Add tests
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user