private getBackground ( Behat\Behat\Hook\Scope\AfterStepScope $scope ) : Behat\Gherkin\Node\BackgroundNode | ||
$scope | Behat\Behat\Hook\Scope\AfterStepScope | |
리턴 | Behat\Gherkin\Node\BackgroundNode |
private function getBackground(AfterStepScope $scope)
{
$background = $scope->getFeature()->getBackground();
if (!$background) {
return false;
}
$stepLinesInBackground = array_map(function (StepNode $step) {
return $step->getLine();
}, $background->getSteps());
if (in_array($scope->getStep()->getLine(), $stepLinesInBackground)) {
return $background;
}
return false;
}