public function testPrototypes() { $client = new Client(); $request_proto = $this->createRequestMock(); $request_proto->method('createClone')->willReturnSelf(); $client->setRequestPrototype($request_proto); $this->assertTrue($request_proto === $client->getRequestPrototype()); $this->assertTrue($client->createRequest() instanceof RequestInterface); $response_proto = $this->createResponseMock(); $client->setResponsePrototype($response_proto); $this->assertTrue($response_proto === $client->getResponsePrototype()); $this->assertTrue($client->createResponse() instanceof ResponseInterface); // Default initialization $client = new Client(); $this->assertTrue($client->getRequestPrototype() instanceof Request); $this->assertTrue($client->getResponsePrototype() instanceof Response); }