Exemple #1
0
 private function executeTestMethod(\ReflectionMethod $method)
 {
     $this->tryExecute('beforeMethod');
     $test = new FunctionTest([$this->class, $method->getName()]);
     $results = $test->execute();
     $this->tryExecute('afterMethod');
     return Arrays::first($results);
 }
Exemple #2
0
 function testExecutionShouldCollectExecutionTime()
 {
     $ms = 10;
     $test = new FunctionTest(function () use($ms) {
         usleep($ms * 1000);
     });
     $result = $test->execute()[0];
     $this->assertGreaterThanOrEqual($ms, $result->getExecutionTimeInMs());
 }