toutpratique/vendor/robmorgan/phinx/tests/Phinx/Console/PhinxApplicationTest.php
2015-10-16 15:09:01 +02:00

34 lines
886 B
PHP

<?php
namespace Test\Phinx\Console;
use Symfony\Component\Console\Tester\ApplicationTester;
use Phinx\Console\PhinxApplication;
class PhinxApplicationTest extends \PHPUnit_Framework_TestCase
{
/**
* @dataProvider provider
*/
public function testRun($command, $result)
{
$app = new \Phinx\Console\PhinxApplication('testing');
$app->setAutoExit(false); // Set autoExit to false when testing
$app->setCatchExceptions(false);
$appTester = new ApplicationTester($app);
$appTester->run(array('command' => $command));
$stream = $appTester->getOutput()->getStream();
rewind($stream);
$this->assertRegExp($result, stream_get_contents($stream));
}
public function provider()
{
return array(
array('help', '/help \[options\] \[--\] \[<command_name>\]/')
);
}
}