ZendTest\Stratigility\DispatchTest::testProcessWillInjectMiddlewarePipeWithResponsePrototypeIfPipelineDoesNotHaveOne PHP Метод

testProcessWillInjectMiddlewarePipeWithResponsePrototypeIfPipelineDoesNotHaveOne() публичный Метод

    public function testProcessWillInjectMiddlewarePipeWithResponsePrototypeIfPipelineDoesNotHaveOne()
    {
        $request = $this->prophesize(ServerRequestInterface::class)->reveal();
        $response = $this->prophesize(ResponseInterface::class)->reveal();
        $next = $this->prophesize(Next::class);
        $next->willImplement(DelegateInterface::class);
        $pipeline = $this->prophesize(MiddlewarePipe::class);
        $pipeline->hasResponsePrototype()->willReturn(false);
        $pipeline->setResponsePrototype($response)->shouldBeCalled();
        $pipeline->process($request, $next->reveal())->willReturn($response);
        $dispatch = new Dispatch();
        $dispatch->setResponsePrototype($response);
        $this->assertSame($response, $dispatch->process(new Route('/', $pipeline->reveal()), $request, $next->reveal()));
    }
DispatchTest