56 $bench = $this->getMockBuilder( Benchmarker::class )
57 ->setMethods( [
'execute',
'output',
'hasOption',
'verboseRun' ] )
59 $benchProxy = TestingAccessWrapper::newFromObject( $bench );
60 $benchProxy->defaultCount = 1;
62 $bench->expects( $this->exactly( 2 ) )->method(
'hasOption' )
63 ->will( $this->returnValueMap( [
68 $bench->expects( $this->once() )->method(
'verboseRun' )
73 'test' =>
function () {
120 $bench = $this->getMockBuilder( Benchmarker::class )
121 ->setMethods( [
'execute',
'output',
'hasOption',
'startBench',
'addResult' ] )
123 $benchProxy = TestingAccessWrapper::newFromObject( $bench );
124 $benchProxy->defaultCount = 1;
126 $bench->expects( $this->exactly( 2 ) )->method(
'hasOption' )
127 ->will( $this->returnValueMap( [
132 $bench->expects( $this->once() )->method(
'output' )
133 ->with( $this->callback(
function (
$out ) {
134 return preg_match(
'/memory.+ peak/',
$out ) === 1;
138 'test' =>
function () {