Files

37 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2017-01-01 01:28:58 -03:00
<?php
2017-01-01 18:20:43 -03: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 01:28:58 -03:00
namespace Mage\Tests\Command\BuiltIn;
use Mage\Command\AbstractCommand;
2017-01-04 21:46:40 -03:00
use Mage\Command\BuiltIn\VersionCommand;
use Mage\Tests\MageApplicationMockup;
2017-01-01 01:28:58 -03:00
use Mage\Mage;
use Symfony\Component\Console\Tester\CommandTester;
use PHPUnit\Framework\TestCase;
2017-01-01 01:28:58 -03:00
class VersionCommandTest extends TestCase
{
public function testVersionOutput()
{
2017-01-29 18:25:02 -03:00
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/basic.yml');
2017-01-01 01:28:58 -03:00
/** @var AbstractCommand $command */
$command = $application->find('version');
2017-01-04 21:46:40 -03:00
$this->assertTrue($command instanceof VersionCommand);
2017-01-01 01:28:58 -03:00
$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 01:34:14 -03:00
}