Exemplo n.º 1
0
 public function testSuccess(\Codeception\Event\Test $e)
 {
     if ($this->isDetailed($e->getTest())) {
         $this->message('PASSED')->center(' ')->style('ok')->append("\n")->writeln();
         return;
     }
     $this->message('Ok')->writeln();
 }
Exemplo n.º 2
0
 public function endTest(\Codeception\Event\Test $e)
 {
     $test = $e->getTest();
     if (!$this->lastTestFailed) {
         $this->formattedTestOutput($test, 'Ok', '.');
     }
     $this->lastTestFailed = FALSE;
 }
Exemplo n.º 3
0
 public function after(\Codeception\Event\Test $e)
 {
     if (!$e->getTest() instanceof TestCase) {
         return;
     }
     foreach (\Codeception\SuiteManager::$modules as $module) {
         $module->_after($e->getTest());
     }
 }
 public function beforeTest(\Codeception\Event\Test $e)
 {
     if (!$this->module) {
         return;
     }
     $cookie = array('CodeCoverage' => $e->getTest()->getName(), 'CodeCoverage_Suite' => $this->suite_name, 'CodeCoverage_Config' => $this->settings['remote_config']);
     $this->module->amOnPage('/');
     $this->module->setCookie('CODECEPTION_CODECOVERAGE', json_encode($cookie));
 }
Exemplo n.º 5
0
 public function after(\Codeception\Event\Test $e)
 {
     $seconds_input = $e->getTime();
     // stack overflow: http://stackoverflow.com/questions/16825240/how-to-convert-microtime-to-hhmmssuu
     $seconds = (int) ($milliseconds = (int) ($seconds_input * 1000)) / 1000;
     $time = $seconds % 60 . ($milliseconds === 0 ? '' : '.' . $milliseconds);
     $this->write($e->getTest()->getFeature());
     $this->writeln(' (' . $time . 's)');
 }
Exemplo n.º 6
0
 public function afterTest(\Codeception\Event\Test $e)
 {
     if (!$e->getTest() instanceof \Codeception\TestCase\Cest) {
         return;
     }
     $test = $e->getTest();
     if (method_exists($test->getTestClass(), '_after')) {
         $test->getTestClass()->_after($e);
     }
 }
Exemplo n.º 7
0
 protected function fire($event, \Codeception\Event\Test $eventType)
 {
     $test = $eventType->getTest();
     if ($test instanceof TestCase) {
         foreach ($test->getScenario()->getGroups() as $group) {
             $this->dispatcher->dispatch($event . '.' . $group, $eventType);
         }
     }
     $this->dispatcher->dispatch($event, $eventType);
 }
Exemplo n.º 8
0
 public function _before(\Codeception\Event\Test $t)
 {
     if (floatval(phpversion()) == '5.3') {
         $t->getTest()->getScenario()->skip();
     }
 }
Exemplo n.º 9
0
 public function testSuccess(\Codeception\Event\Test $e)
 {
     $this->formattedTestOutput($e->getTest(), 'Ok', '.');
 }
Exemplo n.º 10
0
 public function beforeTest(\Codeception\Event\Test $e)
 {
     $this->logger = new \Monolog\Logger($e->getTest()->getFileName());
     $this->logger->pushHandler($this->logHandler);
 }
Exemplo n.º 11
0
 public function after(\Codeception\Event\Test $e)
 {
     foreach (\Codeception\SuiteManager::$modules as $module) {
         $module->_after($e->getTest());
     }
 }