private runSpecs ( pho\Suite\Suite $suite ) | ||
$suite | pho\Suite\Suite | The suite containing the specs to run |
private function runSpecs(Suite $suite)
{
foreach ($suite->getSpecs() as $spec) {
// If using the filter option, only run matching specs
$pattern = self::$console->options['filter'];
if ($pattern && !preg_match($pattern, $spec)) {
continue;
}
$this->runBeforeEachHooks($suite);
$this->reporter->beforeSpec($spec);
$this->runRunnable($spec);
$this->reporter->afterSpec($spec);
$this->runAfterEachHooks($suite);
if ($spec->exception) {
self::$console->setExitStatus(1);
if (self::$console->options['stop']) {
$this->reporter->afterRun();
exit(1);
}
}
}
}