当前位置: 首页>>代码示例>>PHP>>正文


PHP BeforeScenarioScope::getScenario方法代码示例

本文整理汇总了PHP中Behat\Behat\Hook\Scope\BeforeScenarioScope::getScenario方法的典型用法代码示例。如果您正苦于以下问题:PHP BeforeScenarioScope::getScenario方法的具体用法?PHP BeforeScenarioScope::getScenario怎么用?PHP BeforeScenarioScope::getScenario使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Behat\Behat\Hook\Scope\BeforeScenarioScope的用法示例。


在下文中一共展示了BeforeScenarioScope::getScenario方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
 }
开发者ID:edmondscommerce,项目名称:behat-error-detection-context,代码行数:13,代码来源:ErrorDetectionContext.php

示例2: before

 /**
  * @BeforeScenario
  */
 public function before(BeforeScenarioScope $scope)
 {
     if (!self::$isPrepared) {
         $this->prepare();
         self::$isPrepared = true;
     }
     // Scenario skips a line so it's not a new example
     if ($scope->getScenario()->getLine() !== self::$lastScenarioLine + 1) {
         $this->reset();
     }
     self::$lastScenarioLine = $scope->getScenario()->getLine();
     return;
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:16,代码来源:FeatureContext.php

示例3: registerScenario

 /**
  * @BeforeScenario
  */
 public function registerScenario(BeforeScenarioScope $scope)
 {
     // Scenario not usually available to steps, so we do ourselves.
     // See issue
     $this->scenario = $scope->getScenario();
     //print  $this->scenario->getTitle();
 }
开发者ID:rhabbachi,项目名称:data_starter,代码行数:10,代码来源:FeatureContext.php

示例4: 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;
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:18,代码来源:AppConfiguration.php

示例5: 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('/'));
 }
开发者ID:spheresh,项目名称:behat-drupal-propeople-context,代码行数:11,代码来源:PropeopleContext.php

示例6: getCoverageKeyFromScope

 private function getCoverageKeyFromScope(BeforeScenarioScope $scope)
 {
     $name = $scope->getFeature()->getTitle() . '::' . $scope->getScenario()->getTitle();
     return $name;
 }
开发者ID:victoire,项目名称:victoire,代码行数:5,代码来源:CoverageContext.php

示例7: registerScenario

 /**
  * @BeforeScenario
  */
 public function registerScenario(BeforeScenarioScope $scope)
 {
     // Scenario not usually available to steps, so we do ourselves.
     $this->scenario = $scope->getScenario();
     $this->environment = $scope->getEnvironment();
 }
开发者ID:keelahnkhan,项目名称:devinci-behat-extension,代码行数:9,代码来源:DebugContext.php

示例8: start

 /**
  * @BeforeScenario
  * @param BeforeScenarioScope $event
  */
 public function start(BeforeScenarioScope $event)
 {
     self::$coverage->start($event->getScenario()->getTitle());
 }
开发者ID:epfremmer,项目名称:PHP-Weekly-Issue36,代码行数:8,代码来源:CodeCoverageTrait.php

示例9: 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');
 }
开发者ID:arrrtem,项目名称:TqExtension,代码行数:21,代码来源:TqContext.php

示例10: startCoverage

 /**
  * @BeforeScenario
  */
 public function startCoverage(BeforeScenarioScope $scope)
 {
     self::$coverage->start("{$scope->getFeature()->getTitle()}::{$scope->getScenario()->getTitle()}");
 }
开发者ID:api-platform,项目名称:core,代码行数:7,代码来源:CoverageContext.php

示例11: beforeScenario

 /**
  * @param Scope\BeforeScenarioScope $scope
  *   Scope of the processing scenario.
  *
  * @BeforeScenario
  */
 public function beforeScenario(Scope\BeforeScenarioScope $scope)
 {
     self::collectTags($scope->getScenario()->getTags());
     // No need to keep working element between scenarios.
     $this->unsetWorkingElement();
     // 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');
 }
开发者ID:BR0kEN-,项目名称:TqExtension,代码行数:17,代码来源:TqContext.php

示例12: gatherContexts

 /**
  * @BeforeScenario
  *
  * Allow access to the MinkContext.
  */
 public function gatherContexts(BeforeScenarioScope $scope)
 {
     $environment = $scope->getEnvironment();
     $this->minkContext = $environment->getContext('Drupal\\DrupalExtension\\Context\\MinkContext');
     $this->currentScenario = $scope->getScenario();
     $this->scenarioName = $this->currentScenario->getTitle();
 }
开发者ID:cameronandwilding,项目名称:CWTest_Behat,代码行数:12,代码来源:HelperContext.php

示例13: setCurrentScenarioLine

 /**
  * set scenario line number to make screenshots for background steps
  *
  * @BeforeScenario
  *
  * @param BeforeScenarioScope $scope [description]
  *
  * @return null
  */
 public function setCurrentScenarioLine(BeforeScenarioScope $scope)
 {
     $this->currentScenarioLineNumber = $scope->getScenario()->getLine();
 }
开发者ID:afterdesign,项目名称:behat-gallery,代码行数:13,代码来源:ScreenshotsContext.php

示例14: getCoverageKeyFromScope

 private function getCoverageKeyFromScope(BeforeScenarioScope $scope) : string
 {
     return sprintf('%s::%s', $scope->getFeature()->getTitle(), $scope->getScenario()->getTitle());
 }
开发者ID:soyuka,项目名称:core,代码行数:4,代码来源:CoverageContext.php


注:本文中的Behat\Behat\Hook\Scope\BeforeScenarioScope::getScenario方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。