通过创建一个非常精简的版本
ProgressStepPrinter.php
然后把它包括在
autoload-dev
在里面
composer.json
用它来代替
Behat
.
progresssteppprinter.php程序
namespace Behat\Behat\Output\Node\Printer\Progress;
use Behat\Behat\Output\Node\Printer\Helper\ResultToStringConverter;
use Behat\Behat\Output\Node\Printer\StepPrinter;
use Behat\Behat\Tester\Result\StepResult;
use Behat\Gherkin\Node\ScenarioLikeInterface as Scenario;
use Behat\Gherkin\Node\StepNode;
use Behat\Testwork\Output\Formatter;
final class ProgressStepPrinter implements StepPrinter {
private $resultConverter;
public function __construct(ResultToStringConverter $resultConverter) {
$this->resultConverter = $resultConverter;
}
public function printStep(Formatter $formatter, Scenario $scenario, StepNode $step, StepResult $result) {
//custom logic to print per step here
}
}
作曲家.json
"autoload-dev": {
"files": [
"features/bootstrap/ProgressStepPrinter.php",
]
},