public function test_that_a_control_callback_can_be_defined() { $e = new Experiment('test experiment'); $control = function () { return true; }; $e->control($control); $this->assertSame($control, $e->getControl()); }
/** * Run the control callback, and record its execution state. * * @param \Scientist\Experiment $experiment * * @return \Scientist\Result */ protected function runControl(Experiment $experiment) { return (new Machine($experiment->getControl(), $experiment->getParams()))->execute(); }
/** * Run the control callback, and record its execution state. * * @param \Scientist\Experiment $experiment * * @return \Scientist\Execution */ protected function runControl(Experiment $experiment) { return $this->executeCallback($experiment->getControl(), $experiment->getParams(), $experiment->getMatcher()); }