Example #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;
     }
 }
Example #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);
     }
 }
Example #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);
 }
Example #4
0
File: tap.php Project: 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;
 }
Example #5
0
 public function handleEvent($event, atoum\observable $observable)
 {
     $this->score = $event !== atoum\runner::runStop ? null : $observable->getScore()->getCoverage();
     return parent::handleEvent($event, $observable);
 }
 /**
  * @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());
     }
 }
Example #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()));
     }
 }