public function runTests($filter = null)
{
// before
if (isset($this->before_func)) {
\FUnit::debug_out("running before for suite '{$this->name}'");
$before_func = $this->before_func;
$before_func();
unset($before_func);
}
foreach ($this->tests as $name => &$test) {
if (is_null($filter) || stripos($name, $filter) !== false) {
$this->runTest($name);
} else {
$this->tests[$name]['skipped'] = true;
\FUnit::debug_out("skipping test {$name} due to filter '{$filter}'");
}
}
// after
if (isset($this->after_func)) {
\FUnit::debug_out("running after for suite '{$this->name}'");
$after_func = $this->after_func;
$after_func();
unset($after_func);
}
return $this->tests;
}