Example #1
0
 public static function configureBenchmark(ObjectProphecy $benchmark, array $options = array())
 {
     $options = array_merge(array('class' => 'Benchmark', 'beforeClassMethods' => array(), 'afterClassMethods' => array(), 'beforeMethods' => array(), 'afterMethods' => array(), 'path' => null), $options);
     $benchmark->getClass()->willReturn($options['class']);
     $benchmark->getBeforeClassMethods()->willReturn($options['beforeClassMethods']);
     $benchmark->getAfterClassMethods()->willReturn($options['afterClassMethods']);
     $benchmark->getBeforeMethods()->willReturn($options['beforeMethods']);
     $benchmark->getAfterMethods()->willReturn($options['afterMethods']);
     $benchmark->getPath()->willReturn($options['path']);
 }
Example #2
0
 public static function configureSubjectMetadata(ObjectProphecy $subject, array $options = [])
 {
     $options = array_merge(['iterations' => 1, 'name' => 'benchFoo', 'beforeMethods' => [], 'afterMethods' => [], 'parameterSets' => [[[]]], 'groups' => [], 'revs' => 1, 'warmup' => 0, 'notApplicable' => false, 'skip' => false, 'sleep' => 0, 'paramProviders' => [], 'outputTimeUnit' => 'microseconds', 'outputMode' => 'time'], $options);
     $subject->getIterations()->willReturn($options['iterations']);
     $subject->getSleep()->willReturn($options['sleep']);
     $subject->getName()->willReturn($options['name']);
     $subject->getBeforeMethods()->willReturn($options['beforeMethods']);
     $subject->getAfterMethods()->willReturn($options['afterMethods']);
     $subject->getParameterSets()->willReturn($options['parameterSets']);
     $subject->getGroups()->willReturn($options['groups']);
     $subject->getRevs()->willReturn($options['revs']);
     $subject->getSkip()->willReturn($options['skip']);
     $subject->getWarmup()->willReturn($options['warmup']);
     $subject->getParamProviders()->willReturn($options['paramProviders']);
     $subject->getOutputTimeUnit()->willReturn($options['outputTimeUnit']);
     $subject->getOutputMode()->willReturn($options['outputMode']);
 }