Scientist\Report::getTrial PHP Method

getTrial() public method

Get a trial result instance by name.
public getTrial ( string $name ) : Result
$name string
return Result
    public function getTrial($name)
    {
        return $this->trials[$name];
    }

Usage Example

Beispiel #1
0
 public function test_that_report_can_hold_multiple_trial_results()
 {
     $r = new Result();
     $rp = new Report('foo', $r, ['bar' => $r, 'baz' => $r]);
     $this->assertInstanceOf(Result::class, $rp->getTrial('bar'));
     $this->assertInstanceOf(Result::class, $rp->getTrial('baz'));
     $this->assertSame($r, $rp->getTrial('bar'));
     $this->assertSame($r, $rp->getTrial('baz'));
     $this->assertCount(2, $rp->getTrials());
     $this->assertEquals(['bar' => $r, 'baz' => $r], $rp->getTrials());
 }
All Usage Examples Of Scientist\Report::getTrial