Ejemplo n.º 1
0
 public function testHandleRPCException()
 {
     $this->endpoint->expects($this->once())->method('call')->willThrowException(new \Exception('foo', 129));
     $request = new Delivery($this->channel, 'cons', 1, false, '', 'boo', '{}', ['reply-to' => 'foo']);
     $reply = $this->handler->handle($request);
     $this->assertNotNull($reply);
     $headers = $reply->getHeaders();
     $this->assertArrayHasKey('x-error', $headers);
     $this->assertEquals('foo', $headers['x-error']);
     $this->assertArrayHasKey('x-error-code', $headers);
     $this->assertEquals(129, $headers['x-error-code']);
 }