Scientist\Experiment::getTrial PHP Method

getTrial() public method

Fetch a trial callback by name.
public getTrial ( string $name ) : mixed
$name string
return mixed
    public function getTrial($name)
    {
        return $this->trials[$name];
    }

Usage Example

 public function test_that_a_trial_callback_can_be_defined()
 {
     $e = new Experiment('test experiment');
     $trial = function () {
         return true;
     };
     $e->trial('trial', $trial);
     $this->assertSame($trial, $e->getTrial('trial'));
 }