Last active
October 30, 2018 23:39
-
-
Save martinlindhe/83aa60468671e7cf8bed to your computer and use it in GitHub Desktop.
run Behat 3 tests as a phpunit script (to include behat in code coverage count)
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\Component\Console\Input\ArrayInput; | |
use Symfony\Component\Console\Output\ConsoleOutput; | |
use Behat\Behat\ApplicationFactory; | |
class BehatTest extends TestCase | |
{ | |
/** | |
* @group Behat | |
*/ | |
public function testRunBehat() | |
{ | |
$behat = (new ApplicationFactory)->createApplication(); | |
$behat->setAutoExit(false); | |
$input = new ArrayInput(['behat', '--format', 'progress']); | |
$output = new ConsoleOutput(); | |
$result = $behat->run($input, $output); | |
$this->assertEquals(0, $result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment