Created
February 19, 2012 19:00
-
-
Save sotarok/1865194 to your computer and use it in GitHub Desktop.
Running Behat in the Test Case of PHPUnit on Non-Symfony Application.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* @forked https://gist.github.com/1298503 | |
*/ | |
require_once 'behat/autoload.php'; | |
use Symfony\Component\Console\Input\ArrayInput; | |
use Symfony\Component\Console\Output\ConsoleOutput; | |
use Behat\Behat\Console\BehatApplication; | |
class BehatTest | |
extends \PHPUnit_Framework_TestCase | |
{ | |
/** | |
* @group behat | |
*/ | |
public function testBehat() | |
{ | |
try { | |
$input = new ArrayInput(array( | |
'--format' => 'progress' | |
)); | |
$output = new ConsoleOutput(); | |
$app = new BehatApplication('unknown'); | |
$app->setAutoExit(false); | |
$result = $app->run($input, $output); | |
$this->assertEquals(0, $result); | |
} catch (\Exception $e) { | |
$this->fail($e->getMessage()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment