Location: PHPKode > scripts > Phinx > phinx-0.2.x-dev/tests/Phinx/Console/PhinxApplicationTest.php
<?php

namespace Test\Phinx\Console;
 
use Symfony\Component\Console\Tester\ApplicationTester,
    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 \[--xml\] \[command_name\]/')
        );
    }
}
Return current item: Phinx