PhpBench\Benchmark\Metadata\SubjectMetadata::setBeforeMethods PHP Method

setBeforeMethods() public method

public setBeforeMethods ( $beforeMethods )
    public function setBeforeMethods($beforeMethods)
    {
        $this->beforeMethods = $beforeMethods;
    }

Usage Example

コード例 #1
0
ファイル: RunnerTest.php プロジェクト: dantleech/phpbench
 /**
  * It should run the tests.
  *
  * - With 1 iteration, 1 revolution
  * - With 1 iteration, 4 revolutions
  *
  * @dataProvider provideRunner
  */
 public function testRunner($iterations, $revs, array $parameters, $assertionCallbacks)
 {
     $subject = new SubjectMetadata($this->benchmark->reveal(), 'name', 0);
     $subject->setIterations($iterations);
     $subject->setBeforeMethods(['beforeFoo']);
     $subject->setParameterSets([[$parameters]]);
     $subject->setRevs($revs);
     TestUtil::configureBenchmarkMetadata($this->benchmark);
     $this->benchmark->getSubjects()->willReturn([$subject]);
     $this->executor->execute(Argument::type('PhpBench\\Benchmark\\Metadata\\SubjectMetadata'), Argument::type('PhpBench\\Model\\Iteration'), new Config('test', ['executor' => 'microtime']))->shouldBeCalledTimes(count($revs) * array_sum($iterations))->will($this->loadIterationResultCallback());
     $suite = $this->runner->run(new RunnerContext(__DIR__, ['context_name' => 'context']));
     $this->assertInstanceOf('PhpBench\\Model\\Suite', $suite);
     $this->assertNoErrors($suite);
     foreach ($assertionCallbacks as $callback) {
         $callback($this, $suite);
     }
 }
All Usage Examples Of PhpBench\Benchmark\Metadata\SubjectMetadata::setBeforeMethods