PhpBench\Tests\Unit\Benchmark\Executor\MicrotimeExecutorTest::testParametersBeforeSubject PHP Method

testParametersBeforeSubject() public method

It should pass parameters to the before metadata and after metadata methods.
    public function testParametersBeforeSubject()
    {
        $expected = new ParameterSet(0, ['one' => 'two', 'three' => 'four']);
        $this->metadata->getBeforeMethods()->willReturn(['parameterizedBefore']);
        $this->metadata->getAfterMethods()->willReturn(['parameterizedAfter']);
        $this->metadata->getName()->willReturn('parameterized');
        $this->variant->getParameterSet()->willReturn($expected);
        $this->variant->getRevolutions()->willReturn(1);
        $this->variant->getWarmup()->willReturn(0);
        $this->iteration->setResult(Argument::type(TimeResult::class))->shouldBeCalled();
        $this->iteration->setResult(Argument::type(MemoryResult::class))->shouldBeCalled();
        $this->executor->execute($this->metadata->reveal(), $this->iteration->reveal(), new Config('test', []));
        $this->assertTrue(file_exists($this->paramBeforeFile));
        $params = json_decode(file_get_contents($this->paramBeforeFile), true);
        $this->assertEquals($expected->getArrayCopy(), $params);
        $this->assertTrue(file_exists($this->paramAfterFile));
        $params = json_decode(file_get_contents($this->paramAfterFile), true);
        $this->assertEquals($expected->getArrayCopy(), $params);
    }