run() public méthode

Run an experiment, and retrieve the result.
public run ( Experiment $experiment ) : Report
$experiment Experiment
Résultat Report
Exemple #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());
 }
Exemple #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;
 }