PhpBench\Extensions\XDebug\Tests\Unit\Executor\TraceExecutorTest::testLaunchPayload PHP Method

testLaunchPayload() public method

It should launch the payload.
public testLaunchPayload ( )
    public function testLaunchPayload()
    {
        $this->converter->convert(Argument::type('string'))->willReturn($this->dom->reveal());
        $this->dom->evaluate('number(//entry[@function="Test->benchFoo"]/@end-time) - ' . 'number(//entry[@function="Test->benchFoo"]/@start-time)')->willReturn(0.012);
        $this->dom->evaluate('number(//entry[@function="Test->benchFoo"]/@end-memory) - ' . 'number(//entry[@function="Test->benchFoo"]/@start-memory)')->willReturn(100);
        $this->dom->evaluate('count(//entry[@function="Test->benchFoo"]//*)')->willReturn(5);
        //entry[@function="Test->benchFoo"]
        $this->payload->launch()->willReturn(['time' => 66, 'mem' => ['peak' => 10, 'real' => 10, 'final' => 10]]);
        $this->payload->setPhpConfig(['xdebug.trace_output_name' => 'Test::benchFoo.P1', 'xdebug.trace_output_dir' => 'xdebug', 'xdebug.trace_format' => '1', 'xdebug.auto_trace' => '1', 'xdebug.coverage_enable' => '0', 'xdebug.collect_params' => '3'])->shouldBeCalled();
        $this->iteration->setResult(new TimeResult(66))->shouldBeCalled();
        $this->iteration->setResult(new MemoryResult(10, 10, 10))->shouldBeCalled();
        $this->iteration->setResult(Argument::type(XDebugTraceResult::class))->shouldBeCalled();
        $this->executor->launch($this->payload->reveal(), $this->iteration->reveal(), $this->config);
    }