• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Scope\BeforeScenarioScope类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了BeforeScenarioScope类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: gatherContexts

 /**
  * @param BeforeScenarioScope $scope
  *
  * @BeforeScenario
  */
 public function gatherContexts(BeforeScenarioScope $scope)
 {
     $environment = $scope->getEnvironment();
     $this->minkContext = $environment->getContext('Behat\\MinkExtension\\Context\\MinkContext');
     $this->jsonContext = $environment->getContext('Sanpi\\Behatch\\Context\\JsonContext');
     $this->restContext = $environment->getContext('Sanpi\\Behatch\\Context\\RestContext');
 }
开发者ID:soixante,项目名称:service-agora,代码行数:12,代码来源:FeatureContext.php


示例2: linkUsedSubcontexts

 /**
  * @BeforeScenario
  */
 public function linkUsedSubcontexts(BeforeScenarioScope $scope)
 {
     $this->placeholders = $scope->getEnvironment()->getContext('AppBundle\\Behat\\PlaceholderContext');
     if ($scope->getEnvironment()->hasContextClass('Behat\\MinkExtension\\Context\\MinkContext')) {
         $this->mink = $scope->getEnvironment()->getContext('Behat\\MinkExtension\\Context\\MinkContext');
     }
 }
开发者ID:TomasJancauskas,项目名称:HR,代码行数:10,代码来源:BaseContext.php


示例3: gatherContexts

 /** @BeforeScenario */
 public function gatherContexts(BeforeScenarioScope $scope)
 {
     $environment = $scope->getEnvironment();
     $this->flowContext = $environment->getContext('T3DD\\Backend\\Tests\\Behat\\FlowContext');
     $this->webApiContext = $environment->getContext('Behat\\WebApiExtension\\Context\\WebApiContext');
     $this->objectManager = $this->flowContext->getObjectManager();
 }
开发者ID:HofUniversityIWS,项目名称:backend,代码行数:8,代码来源:FeatureContext.php


示例4: init

 /**
  * @BeforeScenario
  */
 public function init(BeforeScenarioScope $scope)
 {
     $environment = $scope->getEnvironment();
     $this->gridContext = $environment->getContext(GridWebContext::class);
     $this->resourceContext = $environment->getContext(ResourceWebContext::class);
     $this->routingContext = $environment->getContext(RoutingContext::class);
 }
开发者ID:php-lug,项目名称:lug,代码行数:10,代码来源:LocaleWebContext.php


示例5: 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


示例6: gatherContext

 /** Fetch the behat environment.
  *
  * @BeforeScenario
  *
  * @param scope
  */
 public function gatherContext(BeforeScenarioScope $scope)
 {
     $this->minkContext = $scope->getEnvironment()->getContext($this->contextName);
     if (!$this->minkContext) {
         $message = sprintf("Unable to fetch the required context: %s", $this->contextName);
         throw new ExpectationException($message, null);
     }
 }
开发者ID:adrianbroher,项目名称:thwboard,代码行数:14,代码来源:HTMLValidateContext.php


示例7: gatherContexts

 /** @BeforeScenario */
 public function gatherContexts(BeforeScenarioScope $scope)
 {
     $environment = $scope->getEnvironment();
     $this->minkContext = $environment->getContext('Sfynx\\BehatBundle\\Behat\\MinkExtension\\Context\\MinkContext');
     $this->ajaxsubcontext = $environment->getContext('Sfynx\\BehatBundle\\Behat\\MinkExtension\\Context\\SubContext\\AjaxContext');
     $this->hiddenfieldsubcontext = $environment->getContext('Sfynx\\BehatBundle\\Behat\\MinkExtension\\Context\\SubContext\\HiddenFieldSubContext');
     $this->xpathxubcontext = $environment->getContext('Sfynx\\BehatBundle\\Behat\\MinkExtension\\Context\\SubContext\\XpathSubContext');
 }
开发者ID:pigroupe,项目名称:SfynxBehatBundle,代码行数:9,代码来源:FeatureContext.php


示例8: gatherContexts

 /**
  * This is used to load in the different contexts so they can be used with in the class
  *
  * @param BeforeScenarioScope $scope
  *
  * @BeforeScenario
  */
 public function gatherContexts(BeforeScenarioScope $scope)
 {
     $environment = $scope->getEnvironment();
     $contexts = $this->_getArrayOfContexts();
     foreach ($contexts as $context => $classVar) {
         $this->{$classVar} = $environment->getContext($context);
     }
 }
开发者ID:edmondscommerce,项目名称:behat-magento-2-context,代码行数:15,代码来源:AbstractMagentoContext.php


示例9: connectToAPIContext

 /**
  * Simple provider for the API context.
  *
  * @param BeforeScenarioScope $scenarioScope
  *
  * @return ApiContext
  */
 public static function connectToAPIContext(BeforeScenarioScope $scenarioScope)
 {
     $environment = $scenarioScope->getEnvironment();
     if (!$environment instanceof InitializedContextEnvironment) {
         throw new \RuntimeException(sprintf('Cannot run tests as current feature context needs to access `ApiContext`, but for that "%s" is needed!', InitializedContextEnvironment::class));
     }
     return $environment->getContext(ApiContext::class);
 }
开发者ID:sententiaregum,项目名称:sententiaregum,代码行数:15,代码来源:ContextHelper.php


示例10: beforeScenario

 /**
  * Perform before scenario actions:
  * - Gather all contexts so they can be reused in the current context.
  *
  * @BeforeScenario
  */
 public function beforeScenario(BeforeScenarioScope $scope)
 {
     // Gather all contexts.
     $contexts = $scope->getEnvironment()->getContexts();
     foreach ($contexts as $context) {
         $context_class_name = get_class($context);
         $this->contexts[$context_class_name] = $context;
     }
 }
开发者ID:stevebresnick,项目名称:iomedia_stp_d7_core,代码行数:15,代码来源:FeatureContext.php


示例11: gatherContexts

 /**
  * @BeforeScenario
  */
 public function gatherContexts(BeforeScenarioScope $scope)
 {
     foreach ($scope->getEnvironment()->getContexts() as $context) {
         if ($context instanceof SubContext) {
             $context->setMainContext($this);
             $this->contexts[$context->getName()] = $context;
         }
     }
     $this->session = $this->getSession();
 }
开发者ID:apalethorpe,项目名称:pimphat,代码行数:13,代码来源:FeatureContext.php


示例12: gatherContexts

 /**
  * @BeforeScenario
  */
 public function gatherContexts(BeforeScenarioScope $scope)
 {
     /** @var Environment $environment */
     $environment = $scope->getEnvironment();
     // Inject the specific contexts so they can be reused here.
     foreach ($this->contexts_map as $key => $class) {
         $context = $environment->getContext($class);
         $this->contexts[$key] = $context;
         unset($this->contexts_map[$key]);
     }
 }
开发者ID:testdrupal,项目名称:behatextension,代码行数:14,代码来源:RawTestDrupalContext.php


示例13: 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


示例14: gatherContexts

 /** @BeforeScenario */
 public function gatherContexts(BeforeScenarioScope $scope)
 {
     $environment = $scope->getEnvironment();
     foreach ($environment->getContexts() as $context) {
         if ($context instanceof \Behat\MinkExtension\Context\RawMinkContext) {
             $context->getSession('default')->setRequestHeader('Accept', 'text/html');
             $username = $this->kernel->getContainer()->getParameter('api_wtw_repositories_user_name_super');
             $password = $this->kernel->getContainer()->getParameter('api_wtw_repositories_password');
             $context->getSession('default')->setBasicAuth($username, $password);
         }
     }
 }
开发者ID:WeavingTheWeb,项目名称:devobs,代码行数:13,代码来源:FeatureContext.php


示例15: 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


示例16: before

 /**
  * @BeforeScenario
  */
 public function before(BeforeScenarioScope $scope)
 {
     $environment = $scope->getEnvironment();
     $this->minkContext = $environment->getContext('Drupal\\DrupalExtension\\Context\\MinkContext');
     if (module_exists('maillog')) {
         $this->maillog_last_id = (int) db_query('SELECT MAX(idmaillog) FROM {maillog}')->fetchField();
         // maillog configuration
         variable_set('maillog_send', 0);
         variable_set('maillog_log', 1);
         variable_set('maillog_devel', 0);
         // Set the the maillog handler in all mail system types
         $mail_system = array('default-system' => 'MaillogMailSystem', 'htmlmail' => 'MaillogMailSystem', 'variable_email' => 'MaillogMailSystem', 'maillog' => 'MaillogMailSystem');
         variable_set('mail_system', $mail_system);
     }
 }
开发者ID:Roomify,项目名称:roomifyextension,代码行数:18,代码来源:RoomifyContext.php


示例17: 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


示例18: gatherOutcomeContext

 /**
  * @BeforeScenario
  *
  * @param BeforeScenarioScope $scope
  */
 public function gatherOutcomeContext(BeforeScenarioScope $scope)
 {
     /** @var \Behat\Behat\Context\Environment\InitializedContextEnvironment $environment */
     $environment = $scope->getEnvironment();
     $this->webApiContext = $environment->getContext('Muchacuba\\WebApiContext');
 }
开发者ID:nabelhm,项目名称:api,代码行数:11,代码来源:WebApiDebugContext.php


示例19: before

 /**
  * @BeforeScenario
  */
 public function before(BeforeScenarioScope $scope)
 {
     $environment = $scope->getEnvironment();
     $this->minkContext = $environment->getContext('Drupal\\DrupalExtension\\Context\\MinkContext');
 }
开发者ID:Roomify,项目名称:casa_build,代码行数:8,代码来源:FeatureContext.php


示例20: gatherRootContext

 /**
  * @BeforeScenario
  *
  * @param BeforeScenarioScope $scope
  */
 public function gatherRootContext(BeforeScenarioScope $scope)
 {
     /** @var InitializedContextEnvironment $environment */
     $environment = $scope->getEnvironment();
     $this->rootContext = $environment->getContext('Muchacuba\\Context');
 }
开发者ID:nabelhm,项目名称:api,代码行数:11,代码来源:Context.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Node\PyStringNode类代码示例发布时间:2022-05-23
下一篇:
PHP Base\Publicacion类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap