Exemplo n.º 1
0
 public function handleEvent($event, atoum\observable $observable)
 {
     $this->score = $event !== atoum\runner::runStop ? null : $observable->getScore();
     try {
         return parent::handleEvent($event, $observable);
     } catch (atoum\writers\http\exception $exception) {
         return $this;
     }
 }
Exemplo n.º 2
0
 /**
  * @param string $event
  * @param observable $observable
  */
 public function handleEvent($event, observable $observable)
 {
     if ($event == atoum\test::beforeTearDown && $observable instanceof \mageekguy\atoum\test) {
         $this->rescorer->rescore($observable->getScore());
     }
     if ($event == atoum\runner::runStart && $observable instanceof \mageekguy\atoum\runner) {
         $outputHandler = new outputHandler();
         $outputHandler->handle($observable, $this->rescorer);
     }
 }
Exemplo n.º 3
0
 public function handleEvent($event, atoum\observable $observable)
 {
     $this->score = $observable->getScore();
     if ($event === atoum\test::runStart) {
         $this->testClassNumber++;
     }
     if ($event === atoum\test::beforeTestMethod) {
         $this->testMethodNumber++;
     }
     return parent::handleEvent($event, $observable);
 }
Exemplo n.º 4
0
Arquivo: tap.php Projeto: atoum/atoum
 private function renderErrors(atoum\observable $observable, $class, $method)
 {
     $errors = '';
     foreach ($observable->getScore()->getErrors() as $error) {
         if ($error['class'] === $class && $error['method'] === $method) {
             $errorType = atoum\asserters\error::getAsString($error['type']);
             $errors .= '# ' . $errorType . ' : ' . str_replace(PHP_EOL, PHP_EOL . '# ', trim($error['message'])) . PHP_EOL;
             $errors .= '# ' . (isset($error['errorFile']) ? $error['errorFile'] : $error['file']) . ':' . (isset($error['errorLine']) ? $error['errorLine'] : $error['line']) . PHP_EOL;
         }
     }
     return $errors;
 }
Exemplo n.º 5
0
 public function handleEvent($event, atoum\observable $observable)
 {
     $this->score = $event !== atoum\runner::runStop ? null : $observable->getScore()->getCoverage();
     return parent::handleEvent($event, $observable);
 }
Exemplo n.º 6
0
 /**
  * @param string $event
  * @param observable $observable
  */
 public function handleEvent($event, observable $observable)
 {
     if ($event == atoum\test::beforeTearDown && $observable instanceof \mageekguy\atoum\test) {
         $this->rescorer->rescore($observable->getScore());
     }
 }
Exemplo n.º 7
0
 /**
  * @param string $event
  * @param observable $observable
  */
 public function handleEvent($event, observable $observable)
 {
     if ($this->underScrutiny() && $event == atoum\test::beforeTearDown && $observable instanceof \mageekguy\atoum\test) {
         $observable->setScore($this->getCleanedScore($observable->getScore()));
     }
 }