@@ -42,13 +42,15 @@ public function testCreateFromAmqpEnvelope()
42
42
$ amqpEnvelope ->method ('getDeliveryMode ' )->willReturn (2 );
43
43
$ amqpEnvelope ->method ('getPriority ' )->willReturn (5 );
44
44
$ amqpEnvelope ->method ('getAppId ' )->willReturn ('appid ' );
45
+ $ amqpEnvelope ->method ('getCorrelationId ' )->willReturn ('foo ' );
45
46
46
47
$ stamp = AmqpStamp::createFromAmqpEnvelope ($ amqpEnvelope );
47
48
48
49
$ this ->assertSame ($ amqpEnvelope ->getRoutingKey (), $ stamp ->getRoutingKey ());
49
50
$ this ->assertSame ($ amqpEnvelope ->getDeliveryMode (), $ stamp ->getAttributes ()['delivery_mode ' ]);
50
51
$ this ->assertSame ($ amqpEnvelope ->getPriority (), $ stamp ->getAttributes ()['priority ' ]);
51
52
$ this ->assertSame ($ amqpEnvelope ->getAppId (), $ stamp ->getAttributes ()['app_id ' ]);
53
+ $ this ->assertSame ($ amqpEnvelope ->getCorrelationId (), $ stamp ->getAttributes ()['correlation_id ' ]);
52
54
$ this ->assertSame (\AMQP_NOPARAM , $ stamp ->getFlags ());
53
55
}
54
56
@@ -59,15 +61,20 @@ public function testCreateFromAmqpEnvelopeWithPreviousStamp()
59
61
$ amqpEnvelope ->method ('getDeliveryMode ' )->willReturn (2 );
60
62
$ amqpEnvelope ->method ('getPriority ' )->willReturn (5 );
61
63
$ amqpEnvelope ->method ('getAppId ' )->willReturn ('appid ' );
64
+ $ amqpEnvelope ->method ('getCorrelationId ' )->willReturn ('foo ' );
62
65
63
- $ previousStamp = new AmqpStamp ('otherroutingkey ' , \AMQP_MANDATORY , ['priority ' => 8 ]);
66
+ $ previousStamp = new AmqpStamp ('otherroutingkey ' , \AMQP_MANDATORY , [
67
+ 'priority ' => 8 ,
68
+ 'correlation_id ' => 'bar ' ,
69
+ ]);
64
70
65
71
$ stamp = AmqpStamp::createFromAmqpEnvelope ($ amqpEnvelope , $ previousStamp );
66
72
67
73
$ this ->assertSame ('otherroutingkey ' , $ stamp ->getRoutingKey ());
68
74
$ this ->assertSame ($ amqpEnvelope ->getDeliveryMode (), $ stamp ->getAttributes ()['delivery_mode ' ]);
69
75
$ this ->assertSame (8 , $ stamp ->getAttributes ()['priority ' ]);
70
76
$ this ->assertSame ($ amqpEnvelope ->getAppId (), $ stamp ->getAttributes ()['app_id ' ]);
77
+ $ this ->assertSame ('bar ' , $ stamp ->getAttributes ()['correlation_id ' ]);
71
78
$ this ->assertSame (\AMQP_MANDATORY , $ stamp ->getFlags ());
72
79
}
73
80
}
0 commit comments