Here we have the results of our experiment. My fingers are crossed for you! - Dayle.
Пример #1
0
 public function test_result_can_have_total_memory_usage()
 {
     $r = new Result();
     $r->setStartMemory(2);
     $r->setEndMemory(5);
     $this->assertEquals(3, $r->getMemory());
 }
Пример #2
0
 /**
  * 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);
         }
     }
 }
Пример #3
0
 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());
 }
Пример #4
0
 /**
  * Set values after the callback has executed.
  *
  * @return void
  */
 protected function setEndValues()
 {
     $this->result->setEndTime(microtime(true));
     $this->result->setEndMemory(memory_get_usage());
 }