示例#1
0
 protected function setUp()
 {
     $this->moduleContainer = new ModuleContainer(Stub::make('Codeception\\Lib\\Di'), []);
     $this->moduleContainer->create('EmulateModuleHelper');
     $this->modules = $this->moduleContainer->all();
     $this->actions = $this->moduleContainer->getActions();
     $this->makeCommand('\\Codeception\\Command\\GenerateScenarios');
     $this->config = array('paths' => array('tests' => 'tests/data/claypit/tests/', 'data' => '_data'), 'class_name' => 'DumbGuy', 'path' => 'tests/data/claypit/tests/dummy/');
 }
示例#2
0
 /**
  * @param $t
  * @throws Exception\InjectionException
  */
 protected function configureTest($t)
 {
     if (!$t instanceof TestInterface) {
         return;
     }
     $t->getMetadata()->setServices(['di' => clone $this->di, 'dispatcher' => $this->dispatcher, 'modules' => $this->moduleContainer]);
     $t->getMetadata()->setCurrent(['actor' => $this->getActor(), 'env' => $this->env, 'modules' => $this->moduleContainer->all()]);
 }
示例#3
0
 protected function createSuite($name)
 {
     $suite = new Lib\Suite();
     $suite->setBaseName($this->env ? substr($name, 0, strpos($name, '-' . $this->env)) : $name);
     if ($this->settings['namespace']) {
         $name = $this->settings['namespace'] . ".{$name}";
     }
     $suite->setName($name);
     $suite->setModules($this->moduleContainer->all());
     return $suite;
 }
 protected function createSuite($name)
 {
     $suite = new Lib\Suite();
     $suite->setBaseName(preg_replace('~\\s.+$~', '', $name));
     // replace everything after space (env name)
     if ($this->settings['namespace']) {
         $name = $this->settings['namespace'] . ".{$name}";
     }
     $suite->setName($name);
     $suite->setModules($this->moduleContainer->all());
     return $suite;
 }
示例#5
0
 protected function getModules()
 {
     return $this->moduleContainer->all();
 }
示例#6
0
 public function initConfig()
 {
     $this->scenario = new Scenario($this, ['env' => $this->env, 'modules' => $this->moduleContainer->all(), 'name' => $this->testName]);
     $this->parser = new Parser($this->scenario);
     return $this;
 }