/** * Add a function to the benchmark. * * @param callable|BenchmarkInterface $test * @param string $title */ public function addBenchmark($test, $title) { if (!$test instanceof \Closure && !$test instanceof BenchmarkInterface) { throw new \InvalidArgumentException('Test must be closure or implement TestInterface'); } $this->tests[] = $test; $this->output->addTest($title); }