public function test_result_can_have_total_memory_usage() { $r = new Result(); $r->setStartMemory(2); $r->setEndMemory(5); $this->assertEquals(3, $r->getMemory()); }
/** * Determine whether trial results match the control. * * @param \Scientist\Matchers\Matcher $matcher * @param \Scientist\Result $control * @param \Scientist\Result[] $trials */ protected function determineMatches(Matcher $matcher, Result $control, array $trials = []) { foreach ($trials as $trial) { if ($matcher->match($control->getValue(), $trial->getValue())) { $trial->setMatch(true); } } }
public function test_that_result_has_trial_executions() { $control = new Execution(true, 10.0, true, true); $trial = new Execution(true, 82.0, true, true); $r = new Result('name', $control, ['bar' => $trial]); $this->assertInstanceOf(Execution::class, $r->trial('bar')); $this->assertEquals(82.0, $r->trial('bar')->getTime()); }
/** * Set values after the callback has executed. * * @return void */ protected function setEndValues() { $this->result->setEndTime(microtime(true)); $this->result->setEndMemory(memory_get_usage()); }