Interns do all the hard work, naturally. They'll execute an experiment within the Laboratory, and record the results.
예제 #1
0
 public function test_that_intern_can_match_and_mismatch_control_and_trial()
 {
     $i = new Intern();
     $e = new Experiment('test experiment', new Laboratory());
     $e->control(function () {
         return 'foo';
     });
     $e->trial('bar', function () {
         return 'foo';
     });
     $e->trial('baz', function () {
         return 'baz';
     });
     $v = $i->run($e);
     $this->assertInstanceOf('\\Scientist\\Report', $v);
     $this->assertTrue($v->getTrial('bar')->isMatch());
     $this->assertFalse($v->getTrial('baz')->isMatch());
 }
예제 #2
0
 /**
  * Run an experiment and return the result.
  *
  * @param \Scientist\Experiment $experiment
  *
  * @return \Scientist\Report
  */
 public function getReport(Experiment $experiment)
 {
     $intern = new Intern();
     $report = $intern->run($experiment);
     $this->reportToJournals($experiment, $report);
     return $report;
 }