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

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

    public function testProcessWillNotInjectMiddlewarePipeWithResponsePrototypeIfPipelineAlreadyHasOne()
    {
        $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(true);
        $pipeline->setResponsePrototype($response)->shouldNotBeCalled();
        $pipeline->process($request, $next->reveal())->willReturn(null);
        $dispatch = new Dispatch();
        $dispatch->setResponsePrototype($response);
        $this->assertNull($dispatch->process(new Route('/', $pipeline->reveal()), $request, $next->reveal()));
    }
DispatchTest