Last active
April 28, 2017 21:28
-
-
Save dantudor/4594469 to your computer and use it in GitHub Desktop.
Behat Tests in PHPUnit with Symfony 2.1
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 | |
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
use Symfony\Component\Console\Input\ArrayInput; | |
use Symfony\Component\Console\Output\ConsoleOutput; | |
use Behat\Behat\Console\BehatApplication; | |
class BehatTest extends WebTestCase | |
{ | |
/** | |
*/ | |
public function testThatBehatScenariosMeetAcceptanceCriteria() | |
{ | |
$features = '@AcmeDemoBundle'; | |
try { | |
$input = new ArrayInput(array('--format' => 'progress', 'features' => $features)); | |
$output = new ConsoleOutput(); | |
$app = new \Behat\Behat\Console\BehatApplication('DEV'); | |
$app->setAutoExit(false); | |
$result = $app->run($input, $output); | |
$this->assertEquals(0, $result); | |
} catch (\Exception $exception) { | |
$this->fail($exception->getMessage()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment