getControl() public method

Fetch the control callback.
public getControl ( ) : callable
return callable
 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());
 }
Example #2
0
 /**
  * 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();
 }
Example #3
0
 /**
  * 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());
 }