public function handleEvent($event, observable $observable) { if (parent::handleEvent($event, $observable) === false) { return false; } else { if ($observable->codeCoverageIsEnabled() === true) { $this->coverage = $observable->getScore()->getCoverage(); if ($this->adapter->extension_loaded('xdebug') === true) { $phpCode = '<?php ' . 'ob_start();' . 'require \'' . \mageekguy\atoum\directory . '/classes/autoloader.php\';'; $bootstrapFile = $observable->getBootstrapFile(); if ($bootstrapFile !== null) { $phpCode .= '$includer = new mageekguy\\atoum\\includer();' . 'try { $includer->includePath(\'' . $bootstrapFile . '\'); }' . 'catch (mageekguy\\atoum\\includer\\exception $exception)' . '{ die(\'Unable to include bootstrap file \\\'' . $bootstrapFile . '\\\'\'); }'; } $phpCode .= '$data = array(\'classes\' => get_declared_classes());' . 'ob_start();' . 'xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);' . 'require_once \'%s\';' . '$data[\'coverage\'] = xdebug_get_code_coverage();' . 'xdebug_stop_code_coverage();' . 'ob_end_clean();' . '$data[\'classes\'] = array_diff(get_declared_classes(), $data[\'classes\']);' . 'echo serialize($data);'; foreach ($this->getSrcDirectoryIterators() as $srcDirectoryIterator) { foreach ($srcDirectoryIterator as $file) { if (in_array($file->getPathname(), $this->adapter->get_included_files()) === false) { if ($this->php->reset()->run(sprintf($phpCode, $file->getPathname()))->getExitCode() > 0) { throw new runtime('Unable to get default code coverage for file \'' . $file->getPathname() . '\': ' . $this->php->getStderr()); } $data = unserialize($this->php->getStdOut()); foreach ($data['classes'] as $class) { $this->coverage->addXdebugDataForClass($class, $data['coverage']); } } } } } return true; } } }
public function handleEvent($event, observable $observable) { if (parent::handleEvent($event, $observable) === false) { return false; } else { $score = $observable->getScore(); $this->testNumber = $observable->getTestNumber(); $this->testMethodNumber = $observable->getTestMethodNumber(); $this->assertionNumber = $score->getAssertionNumber(); $this->failNumber = $score->getFailNumber(); $this->errorNumber = $score->getErrorNumber(); $this->exceptionNumber = $score->getExceptionNumber(); $this->voidMethodNumber = $score->getVoidMethodNumber(); $this->uncompletedMethodNumber = $score->getUncompletedMethodNumber(); $this->skippedMethodNumber = $score->getSkippedMethodNumber(); $this->success = $this->failNumber === 0 && $this->errorNumber === 0 && $this->exceptionNumber === 0 && $this->uncompletedMethodNumber === 0; if ($observable->shouldFailIfVoidMethods() && $this->voidMethodNumber > 0) { $this->success = false; } if ($observable->shouldFailIfSkippedMethods() && $this->skippedMethodNumber > 0) { $this->success = false; } return true; } }
public function handleEvent($event, \mageekguy\atoum\observable $observable) { if (parent::handleEvent($event, $observable) === false) { return false; } else { $this->testMethodNumber = $observable->getTestMethodNumber(); return true; } }
public function handleEvent($event, observable $observable) { if (parent::handleEvent($event, $observable) === false) { return false; } else { $this->runner = $observable; return true; } }
public function handleEvent($event, observable $observable) { if (parent::handleEvent($event, $observable) === false) { return false; } else { $this->value = $observable->getScore()->getTotalDuration(); return true; } }
public function handleEvent($event, atoum\observable $observable) { if (parent::handleEvent($event, $observable) === false) { return false; } else { $this->path = $observable->getScore()->getAtoumPath() . DIRECTORY_SEPARATOR . $_SERVER['argv'][0]; return true; } }
public function handleEvent($event, atoum\observable $observable) { if (parent::handleEvent($event, $observable) === false) { return false; } else { $this->version = $observable->getScore()->getPhpVersion(); return true; } }
public function handleEvent($event, \mageekguy\atoum\observable $observable) { if (parent::handleEvent($event, $observable) === false) { return false; } else { $this->coverage = $observable->getScore()->getCoverage(); return true; } }
public function handleEvent($event, atoum\observable $observable) { if (parent::handleEvent($event, $observable) === false) { return false; } else { $this->testClass = $observable->getClass(); return true; } }
public function handleEvent($event, atoum\observable $observable) { if (parent::handleEvent($event, $observable) === false) { return false; } else { $this->value = $observable->getScore()->getTotalMemoryUsage(); $this->testNumber = $observable->getTestNumber(); return true; } }
public function handleEvent($event, \mageekguy\atoum\observable $observable) { if (parent::handleEvent($event, $observable) === false) { return false; } else { $this->author = \mageekguy\atoum\author; $this->path = $observable->getScore()->getAtoumPath(); $this->version = $observable->getScore()->getAtoumVersion(); return true; } }
public function handleEvent($event, atoum\observable $observable) { if (parent::handleEvent($event, $observable) === false) { $this->observable = null; $this->event = null; return false; } else { $this->observable = $observable; $this->event = $event; return true; } }