2017-01-01 05:28:58 +01:00
|
|
|
<?php
|
2017-01-01 22:20:43 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the Magallanes package.
|
|
|
|
*
|
|
|
|
* (c) Andrés Montañez <andres@andresmontanez.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2017-01-01 05:28:58 +01:00
|
|
|
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;
|
2017-01-01 06:14:17 +01:00
|
|
|
use PHPUnit_Framework_TestCase as TestCase;
|
2017-01-01 05:28:58 +01:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
2017-01-01 05:34:14 +01:00
|
|
|
}
|