本文整理汇总了PHP中Behat\Behat\Hook\Scope\BeforeScenarioScope::getFeature方法的典型用法代码示例。如果您正苦于以下问题:PHP BeforeScenarioScope::getFeature方法的具体用法?PHP BeforeScenarioScope::getFeature怎么用?PHP BeforeScenarioScope::getFeature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Behat\Behat\Hook\Scope\BeforeScenarioScope
的用法示例。
在下文中一共展示了BeforeScenarioScope::getFeature方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforeScenario
/**
*
* @BeforeScenario
*
* @param BeforeScenarioScope $scope
*/
public function beforeScenario(BeforeScenarioScope $scope)
{
$this->scenarioData = ['file' => $scope->getFeature()->getFile(), 'line' => $scope->getScenario()->getLine(), 'title' => $scope->getScenario()->getTitle(), 'tags' => $scope->getScenario()->getTags()];
$this->_w3c = $scope->getEnvironment()->getContext(W3CValidationContext::class);
$this->_screenshot = $scope->getEnvironment()->getContext(ScreenshotContext::class);
$this->setLogPath();
}
示例2: prepareParameters
/**
* @BeforeScenario
*
* Enable the testing app before the first scenario of the feature and
* reset the configs before each scenario
* @param BeforeScenarioScope $event
*/
public function prepareParameters(BeforeScenarioScope $event)
{
$user = $this->currentUser;
$this->currentUser = 'admin';
$scenarios = $event->getFeature()->getScenarios();
if ($event->getScenario() === reset($scenarios)) {
$this->setStatusTestingApp(true);
}
$this->resetAppConfigs();
$this->currentUser = $user;
}
示例3: beforeScenario
/**
* @param BeforeScenarioScope $scope
*
* @BeforeScenario
*/
public function beforeScenario(BeforeScenarioScope $scope)
{
$this->tags += array_merge($scope->getFeature()->getTags(), $scope->getScenario()->getTags());
// Any page should be visited due to using jQuery and checking the cookies.
$this->getSession()->visit($this->locatePath('/'));
}
示例4: getCoverageKeyFromScope
private function getCoverageKeyFromScope(BeforeScenarioScope $scope)
{
$name = $scope->getFeature()->getTitle() . '::' . $scope->getScenario()->getTitle();
return $name;
}
示例5: beforeScenario
/**
* @param Scope\BeforeScenarioScope $scope
*
* @BeforeScenario
*/
public function beforeScenario(Scope\BeforeScenarioScope $scope)
{
foreach (array_merge($scope->getFeature()->getTags(), $scope->getScenario()->getTags()) as $tag) {
$values = explode(':', $tag);
$value = '';
if (count($values) > 1) {
list($tag, $value) = $values;
}
self::$tags[strtolower($tag)] = $value;
}
// Any page should be visited due to using jQuery and checking the cookies.
$this->visitPath('/');
// By "Goutte" session we need to visit any page to be able to set a cookie
// for this session and use it for checking request status codes.
$this->visitPath('/', 'goutte');
}
示例6: startCoverage
/**
* @BeforeScenario
*/
public function startCoverage(BeforeScenarioScope $scope)
{
self::$coverage->start("{$scope->getFeature()->getTitle()}::{$scope->getScenario()->getTitle()}");
}
示例7: getCoverageKeyFromScope
private function getCoverageKeyFromScope(BeforeScenarioScope $scope) : string
{
return sprintf('%s::%s', $scope->getFeature()->getTitle(), $scope->getScenario()->getTitle());
}