public function testWithoutHeader() { $response = new Response([], ['foo' => 'bar', 'baz' => 'qux']); $newResponse = $response->withoutHeader('baz'); $this->assertNotSame($response, $newResponse); $this->assertEquals(['foo' => 'bar'], $newResponse->getHeaders()); }
/** * @param Response $response * * @return AMQPMessage * * @throws \Exception */ private function createReply(Response $response) { $body = json_encode($response->getValue()); if (json_last_error() !== JSON_ERROR_NONE) { throw new EncodingException('Unable to encode response: ' . json_last_error_msg()); } return new AMQPMessage($body, ['application_headers' => new AMQPTable($response->getHeaders())]); }