Ejemplo n.º 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/');
 }
Ejemplo n.º 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()]);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 protected function getModules()
 {
     return $this->moduleContainer->all();
 }
Ejemplo n.º 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;
 }