예제 #1
0
 public function test_that_machine_can_determine_memory_usage_changes()
 {
     $m = new Machine(function () {
     });
     $r = $m->execute();
     $this->assertInternalType('integer', $r->getStartMemory());
     $this->assertInternalType('integer', $r->getEndMemory());
 }
예제 #2
0
 /**
  * Run trial callbacks and record their execution state.
  *
  * @param \Scientist\Experiment $experiment
  *
  * @return \Scientist\Result[]
  */
 protected function runTrials(Experiment $experiment)
 {
     $executions = array();
     foreach ($experiment->getTrials() as $name => $trial) {
         $machine = new Machine($trial, $experiment->getParams(), true);
         $executions[$name] = $machine->execute();
     }
     return $executions;
 }