magallanes/src/Mage/Tests/Command/BuiltIn/VersionCommandTest.php

30 lines
905 B
PHP
Raw Normal View History

2017-01-01 05:28:58 +01:00
<?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);
}
}