Пример #1
0
 /**
  * @covers ::__construct
  * @covers ::getEncodedContent
  * @expectedException RuntimeException
  */
 public function testOver100LevelsOfNestingThrowsAnException()
 {
     $message = 123;
     for ($i = 1; $i <= 101; ++$i) {
         $message = ['message' => $message];
     }
     $message = new OutgoingMessage($message);
     $message->getEncodedContent();
 }
Пример #2
0
 /**
  * @param OutgoingMessage $message
  */
 public function produceMessage(OutgoingMessage $message)
 {
     $this->message_bank->produceMessage($message->getEncodedContent());
 }
Пример #3
0
 /**
  * @param OutgoingMessage $message
  * @return AMQPMessage
  * @throws RuntimeException
  */
 private function generateAmqpMessage(OutgoingMessage $message)
 {
     return new AMQPMessage($message->getEncodedContent(), ['content_type' => 'application/json', 'delivery_mode' => 2]);
 }