/**
  * Initializes provided context.
  *
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof SwiftMailerContext) {
         return;
     }
     $context->setConfiguration($this->manager);
 }
 /**
  * Initializes provided context.
  *
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof DoctrineDbalAwareContext) {
         return;
     }
     $context->setConnection($this->conn);
 }
 /**
  * After each scenario, reboot the kernel.
  */
 public function reboot()
 {
     Facade::clearResolvedInstances();
     $lumen = new LumenBooter($this->app->basePath());
     $this->context->getSession('lumen')->getDriver()->reboot($this->app = $lumen->boot());
     $this->setAppOnContext();
 }
 /**
  * {@inheritdoc}
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof MailCatcherAwareContext) {
         return;
     }
     $context->setMailCatcher($this->mailcatcher);
 }
 /**
  * After each scenario, reboot the kernel.
  */
 public function rebootKernel()
 {
     $this->kernel->flush();
     $laravel = new LaravelBooter($this->kernel->basePath(), $this->kernel->environmentFile());
     $this->context->getSession('laravel')->getDriver()->reboot($this->kernel = $laravel->boot());
     $this->setAppOnContext();
 }
 /**
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof \L0rD59\Behat\LdapExtension\Context) {
         return;
     }
     $context->setConfiguration($this->client, $this->rootDn, $this->bind_before_scenario, $this->purge_before_scenario, $this->authentication);
 }
 /**
  * Initializes provided context.
  *
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if ($context instanceof ApiClientAwareInterface) {
         $context->setClient($this->client);
         $context->setConfig($this->config);
     }
 }
 /**
  * Initializes provided context.
  *
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof EntityManagerAwareContext) {
         return;
     }
     $context->setRegistry($this->registry);
 }
 /**
  * Initializes provided context.
  *
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof ConnectionAwareContextInterface) {
         return;
     }
     $context->setConnection($this->connection);
 }
Example #10
0
 /**
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof MailCatcherContext) {
         return;
     }
     $context->setConfiguration($this->client, $this->purgeBeforeScenario);
 }
 /**
  * Initializes provided context.
  *
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof DoctrineAwareContext) {
         return;
     }
     $context->setEntityManager($this->em);
 }
 /**
  * {@inheritdoc}
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof MakeDoAwareContext) {
         return;
     }
     $context->setMakeDo($this->makeDo);
 }
 /**
  * Checks if initializer supports provided context.
  *
  * @param Context $context
  *
  * @return Boolean
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof AliceAwareInterface) {
         return;
     }
     $context->setExecutor($this->executor);
 }
 /**
  * {@inheritdoc}
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof KernelAwareContext) {
         return;
     }
     $context->setKernel($this->kernel);
 }
 /**
  * Initializes provided context
  *
  * @param Context $context
  *
  * @access public
  * @return void
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof GuzzleAwareContext) {
         return;
     }
     $context->setGuzzleClient($this->client);
     $context->setGuzzleParameters($this->parameters);
 }
 /**
  * Initializes provided context.
  *
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof TransMogrifierContext) {
         return;
     }
     $context->setDatasetDir($this->dataset_dir);
     $context->setDbConfDir($this->dbconf_dir);
 }
 /**
  * Initializes provided context.
  *
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof CollectionAwareContextInterface) {
         return;
     }
     $context->setConnectionCollection($this->collection);
     $context->setDefaultAlias($this->defaultAlias);
 }
 /**
  * Initializes provided context.
  *
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof MinkAwareContext) {
         return;
     }
     $context->setMink($this->mink);
     $context->setMinkParameters($this->parameters);
 }
 /**
  * Initializes provided context.
  *
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof ClipboardContextAwareInterface) {
         return;
     }
     /** @var ClipboardContextAwareInterface $context */
     $context->setClipboard($this->clipboard);
 }
 public function initializeContext(Context $context)
 {
     if (!$context instanceof Typo3AwareContext) {
         return;
     }
     $context->setTypo3($this->typo3);
     $context->setTypo3Parameters($this->parameters);
 }
 /**
  * {@inheritdocs}
  */
 public function initializeContext(Context $context)
 {
     // All contexts are passed here, only DrupalAwareInterface is allowed.
     if (!$context instanceof ScreenshotAwareInterface) {
         return;
     }
     // Add all parameters to the context.
     $context->setScreenshotParameters($this->parameters);
 }
Example #22
0
 /**
  * {@inheritdoc}
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof ApiContextInterface) {
         return;
     }
     $context->setClient($this->client);
     $context->setRequestFactory($this->messageFactory);
     $context->setBaseUrl($this->baseUrl);
 }
 /**
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if ($context instanceof MailCatcherAwareInterface) {
         $context->setMailCatcherClient($this->client);
     }
     if ($context instanceof MailCatcherContext) {
         $context->setMailCatcherConfiguration($this->purgeBeforeScenario);
     }
 }
 /**
  * initialize screenshot context
  * @param  Context $context behat context
  * @return null
  */
 public function initializeContext(Context $context)
 {
     // All contexts are passed here
     if (!$context instanceof ScreenshotsContext) {
         return;
     }
     $screenshotsPath = $this->parameters['screenshot_path'];
     $context->setScreenshotPath($screenshotsPath);
 }
 /**
  * {@inheritdocs}
  */
 public function initializeContext(Context $context)
 {
     // All contexts are passed here, only RawDKANEntityContext is allowed.
     if (!$context instanceof DKANAwareInterface) {
         return;
     }
     $context->setEntityStore($this->entityStore);
     $context->setPageStore($this->pageStore);
     // Add all parameters to the context.
     //$context->setParameters($this->parameters);
 }
 /**
  * {@inheritdocs}
  */
 public function initializeContext(Context $context)
 {
     // All contexts are passed here, only DrupalAwareInterface is allowed.
     if (!$context instanceof EloquaAwareInterface) {
         return;
     }
     // Set ELoqua client.
     $context->setClient($this->client);
     // Set event dispatcher.
     $context->setDispatcher($this->dispatcher);
     // Add all parameters to the context.
     $context->setEloquaParameters($this->parameters);
 }
 /**
  * {@inheritdocs}
  */
 public function initializeContext(Context $context)
 {
     // All contexts are passed here, only DrupalAwareInterface is allowed.
     if (!$context instanceof DrupalAwareInterface) {
         return;
     }
     // Set Drupal driver manager.
     $context->setDrupal($this->drupal);
     // Set event dispatcher.
     $context->setDispatcher($this->dispatcher);
     // Add all parameters to the context.
     $context->setDrupalParameters($this->parameters);
 }
 /**
  * setup the wordpress environment / stack if the context is a wordpress context
  *
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     $factory = new InboxFactory($this->wordpressParams['mail']['directory']);
     if ($context instanceof WordPressInboxFactoryAwareContext) {
         $context->setInboxFactory($factory);
     }
     if (!$context instanceof WordPressContext) {
         return;
     }
     $this->prepareEnvironment();
     $this->overwriteConfig();
     $this->flushDatabase();
     $this->loadStack();
 }
 /**
  * Initializes provided context.
  *
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if (!$context instanceof ServiceManagerAwareInterface) {
         return;
     }
     if (!file_exists($this->file)) {
         throw new \LogicException(sprintf('The file %s was not found', $this->file));
     }
     // We _should_ always be in the root of a zf2 project when executing this
     $config = (include $this->file);
     $serviceManager = new ServiceManager(new ServiceManagerConfig($config));
     $serviceManager->setService('ApplicationConfig', $config);
     /* @var $moduleManager \Zend\ModuleManager\ModuleManager */
     $moduleManager = $serviceManager->get('ModuleManager');
     $moduleManager->loadModules();
     $context->setServiceManager($serviceManager);
 }
 /**
  * {@inheritdocs}
  */
 public function initializeContext(Context $context)
 {
     // All contexts are passed here, only RawTestDrupalEntityContext is allowed.
     if (!$context instanceof TestDrupalAwareInterface) {
         return;
     }
     $context->setEntityStore($this->entityStore);
     $context->setPageStore($this->pageStore);
     // Set the default contexts that should be available.
     if (isset($this->default_contexts_map) && is_array($this->default_contexts_map)) {
         $map = $context->getContextsMap();
         // Override any defaults with whatever the existing values were.
         foreach ($map as $key => $class) {
             $this->default_contexts_map[$key] = $class;
         }
         // Then update the Contexts Map
         $context->setContextsMap($this->default_contexts_map);
     }
     // Add all parameters to the context.
     //$context->setParameters($this->parameters);
 }