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
 public function setUp()
 {
     $this->dispatcher = new Symfony\Component\EventDispatcher\EventDispatcher();
     $di = new \Codeception\Lib\Di();
     $this->moduleContainer = new \Codeception\Lib\ModuleContainer($di, []);
     \Codeception\Module\EmulateModuleHelper::$onlyActions = [];
     \Codeception\Module\EmulateModuleHelper::$excludeActions = [];
     $module = $this->moduleContainer->create('EmulateModuleHelper');
     $module->_initialize();
     $this->testcase = new \Codeception\TestCase\Cept();
     $this->testcase->configDispatcher($this->dispatcher)->configName('mocked test')->configFile(codecept_data_dir() . 'SimpleCept.php')->configDi($di)->configModules($this->moduleContainer)->initConfig();
 }
Ejemplo n.º 3
0
 public function testShortConfigDependencies()
 {
     $config = ['modules' => ['enabled' => [['Codeception\\Lib\\DependencyModule' => ['depends' => 'Codeception\\Lib\\ConflictedModule']]]]];
     $this->moduleContainer = new ModuleContainer(Stub::make('Codeception\\Lib\\Di'), $config);
     $this->moduleContainer->create('Codeception\\Lib\\DependencyModule');
     $this->moduleContainer->hasModule('\\Codeception\\Lib\\DependencyModule');
 }
 public function testInjectModuleIntoHelper()
 {
     $config = ['modules' => ['enabled' => ['Codeception\\Lib\\HelperModule']]];
     $this->moduleContainer = new ModuleContainer(Stub::make('Codeception\\Lib\\Di'), $config);
     $this->moduleContainer->create('Codeception\\Lib\\HelperModule');
     $this->moduleContainer->hasModule('Codeception\\Lib\\HelperModule');
 }
Ejemplo n.º 5
0
 public function __construct(EventDispatcher $dispatcher, $name, array $settings)
 {
     $this->settings = $settings;
     $this->dispatcher = $dispatcher;
     $this->di = new Di();
     $this->path = $settings['path'];
     $this->groupManager = new GroupManager($settings['groups']);
     $this->moduleContainer = new ModuleContainer($this->di, $settings);
     $modules = Configuration::modules($this->settings);
     foreach ($modules as $moduleName) {
         $this->moduleContainer->create($moduleName);
     }
     $this->moduleContainer->validateConflicts();
     if (isset($settings['current_environment'])) {
         $this->env = $settings['current_environment'];
     }
     $this->suite = $this->createSuite($name);
 }