Пример #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
 /**
  * @group core
  */
 public function testRunStepEvents()
 {
     $events = array();
     codecept_debug($this->moduleContainer->getActions());
     $this->dispatcher->addListener('step.before', function () use(&$events) {
         $events[] = 'step.before';
     });
     $this->dispatcher->addListener('step.after', function () use(&$events) {
         $events[] = 'step.after';
     });
     $step = new \Codeception\Step\Action('seeEquals', array(5, 5));
     $this->testcase->runStep($step);
     $this->assertEquals($events, array('step.before', 'step.after'));
 }
Пример #3
0
 public function testShortConfigParts()
 {
     $config = ['modules' => ['enabled' => [['\\Codeception\\Lib\\PartedModule' => ['part' => 'one']]]]];
     $this->moduleContainer = new ModuleContainer(Stub::make('Codeception\\Lib\\Di'), $config);
     $this->moduleContainer->create('\\Codeception\\Lib\\PartedModule');
     $actions = $this->moduleContainer->getActions();
     $this->assertArrayHasKey('partOne', $actions);
     $this->assertArrayNotHasKey('partTwo', $actions);
 }