@@ -42,13 +42,15 @@ public function testCreateFromAmqpEnvelope()
4242 $ amqpEnvelope ->method ('getDeliveryMode ' )->willReturn (2 );
4343 $ amqpEnvelope ->method ('getPriority ' )->willReturn (5 );
4444 $ amqpEnvelope ->method ('getAppId ' )->willReturn ('appid ' );
45+ $ amqpEnvelope ->method ('getCorrelationId ' )->willReturn ('foo ' );
4546
4647 $ stamp = AmqpStamp::createFromAmqpEnvelope ($ amqpEnvelope );
4748
4849 $ this ->assertSame ($ amqpEnvelope ->getRoutingKey (), $ stamp ->getRoutingKey ());
4950 $ this ->assertSame ($ amqpEnvelope ->getDeliveryMode (), $ stamp ->getAttributes ()['delivery_mode ' ]);
5051 $ this ->assertSame ($ amqpEnvelope ->getPriority (), $ stamp ->getAttributes ()['priority ' ]);
5152 $ this ->assertSame ($ amqpEnvelope ->getAppId (), $ stamp ->getAttributes ()['app_id ' ]);
53+ $ this ->assertSame ($ amqpEnvelope ->getCorrelationId (), $ stamp ->getAttributes ()['correlation_id ' ]);
5254 $ this ->assertSame (\AMQP_NOPARAM , $ stamp ->getFlags ());
5355 }
5456
@@ -59,15 +61,20 @@ public function testCreateFromAmqpEnvelopeWithPreviousStamp()
5961 $ amqpEnvelope ->method ('getDeliveryMode ' )->willReturn (2 );
6062 $ amqpEnvelope ->method ('getPriority ' )->willReturn (5 );
6163 $ amqpEnvelope ->method ('getAppId ' )->willReturn ('appid ' );
64+ $ amqpEnvelope ->method ('getCorrelationId ' )->willReturn ('foo ' );
6265
63- $ previousStamp = new AmqpStamp ('otherroutingkey ' , \AMQP_MANDATORY , ['priority ' => 8 ]);
66+ $ previousStamp = new AmqpStamp ('otherroutingkey ' , \AMQP_MANDATORY , [
67+ 'priority ' => 8 ,
68+ 'correlation_id ' => 'bar ' ,
69+ ]);
6470
6571 $ stamp = AmqpStamp::createFromAmqpEnvelope ($ amqpEnvelope , $ previousStamp );
6672
6773 $ this ->assertSame ('otherroutingkey ' , $ stamp ->getRoutingKey ());
6874 $ this ->assertSame ($ amqpEnvelope ->getDeliveryMode (), $ stamp ->getAttributes ()['delivery_mode ' ]);
6975 $ this ->assertSame (8 , $ stamp ->getAttributes ()['priority ' ]);
7076 $ this ->assertSame ($ amqpEnvelope ->getAppId (), $ stamp ->getAttributes ()['app_id ' ]);
77+ $ this ->assertSame ('bar ' , $ stamp ->getAttributes ()['correlation_id ' ]);
7178 $ this ->assertSame (\AMQP_MANDATORY , $ stamp ->getFlags ());
7279 }
7380}
0 commit comments