PhlyTest\Conduit\NextTest::testDoneHandlerReceivesRequestAndResponse PHP Method

testDoneHandlerReceivesRequestAndResponse() public method

    public function testDoneHandlerReceivesRequestAndResponse()
    {
        // e.g., 0 length array, or all handlers call next
        $phpunit = $this;
        $request = $this->request;
        $response = $this->response;
        $triggered = null;
        $done = function ($req, $res, $err = null) use($phpunit, $request, $response, &$triggered) {
            $phpunit->assertSame($request, $req);
            $phpunit->assertSame($response, $response);
            $triggered = true;
        };
        $next = new Next($this->queue, $done);
        $next($request, $response);
        $this->assertTrue($triggered);
    }