You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently in BehatContainerTrait we setup a container ourselves.
I suspect that the best way to intitalise Behat inside phpunitbehat might be to create our own factory class extending \Behat\Behat\ApplicationFactory and then call that factory inside our BehatContainerTrait. This should have good forward-compatability with future versions of Behat, and require us duplicating less Behat code inside phpunitbehat.
<?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);
}
}
The text was updated successfully, but these errors were encountered:
Currently in BehatContainerTrait we setup a container ourselves.
I suspect that the best way to intitalise Behat inside phpunitbehat might be to create our own factory class extending \Behat\Behat\ApplicationFactory and then call that factory inside our BehatContainerTrait. This should have good forward-compatability with future versions of Behat, and require us duplicating less Behat code inside phpunitbehat.
There is a gist https://gist.github.com/martinlindhe/83aa60468671e7cf8bed that suggests this:
The text was updated successfully, but these errors were encountered: