/**
  * @test createMessage copy properties from amqp lib message to driver one
  */
 public function copyPropertiesFromAmqpLib()
 {
     $properties = ['application_headers' => ['x-header-1' => 'value1', 'x-header-2' => 'value2'], 'content_type' => 'application/json', 'content_encoding' => 'utf-8', 'message_id' => '100', 'app_id' => '2', 'user_id' => '10', 'priority' => 3, 'timestamp' => strtotime('2012-12-18 09:45:11'), 'expiration' => 1000, 'type' => 'type_str', 'reply_to' => 'foo.bar'];
     $amqpLibMessage = new AmqpLibMessage('body content', $properties);
     $message = AmqpMessageUtils::createMessage($amqpLibMessage);
     $this->assertEquals('body content', $message->getBody());
     $this->assertEquals($properties['application_headers'], $message->getHeaders());
     $this->assertEquals($properties['content_type'], $message->getContentType());
     $this->assertEquals($properties['content_encoding'], $message->getContentEncoding());
     $this->assertEquals($properties['message_id'], $message->getMessageId());
     $this->assertEquals($properties['app_id'], $message->getAppId());
     $this->assertEquals($properties['user_id'], $message->getUserId());
     $this->assertEquals($properties['priority'], $message->getPriority());
     $this->assertEquals($properties['timestamp'], $message->getTimestamp());
     $this->assertEquals($properties['expiration'], $message->getExpiration());
     $this->assertEquals($properties['type'], $message->getType());
     $this->assertEquals($properties['reply_to'], $message->getReplyTo());
 }
 public static function createDelivery(AmqpLibMessage $msg, $queue)
 {
     return new MessageDelivery(AmqpMessageUtils::createMessage($msg), $msg->delivery_info['delivery_tag'], $msg->delivery_info['exchange'], $queue, $msg->delivery_info['routing_key'], $msg->delivery_info['redelivered']);
 }