@@ -91,8 +91,6 @@ public function testShouldConvertTransportMessageToClientMessage()
91
91
$ transportMessage ->setTimestamp (1000 );
92
92
$ transportMessage ->setReplyTo ('theReplyTo ' );
93
93
$ transportMessage ->setCorrelationId ('theCorrelationId ' );
94
- $ transportMessage ->setReplyTo ('theReplyTo ' );
95
- $ transportMessage ->setCorrelationId ('theCorrelationId ' );
96
94
97
95
$ driver = new SqsDriver (
98
96
$ this ->createPsrContextMock (),
@@ -120,9 +118,15 @@ public function testShouldConvertTransportMessageToClientMessage()
120
118
$ this ->assertSame (1000 , $ clientMessage ->getTimestamp ());
121
119
$ this ->assertSame ('theReplyTo ' , $ clientMessage ->getReplyTo ());
122
120
$ this ->assertSame ('theCorrelationId ' , $ clientMessage ->getCorrelationId ());
121
+ $ this ->assertNull ($ clientMessage ->getDelay ());
123
122
124
123
$ this ->assertNull ($ clientMessage ->getExpire ());
125
124
$ this ->assertSame (MessagePriority::NORMAL , $ clientMessage ->getPriority ());
125
+
126
+ // Test delay
127
+ $ transportMessage ->setDelaySeconds (100 );
128
+ $ clientMessage = $ driver ->createClientMessage ($ transportMessage );
129
+ $ this ->assertSame (100 , $ clientMessage ->getDelay ());
126
130
}
127
131
128
132
public function testShouldConvertClientMessageToTransportMessage ()
@@ -141,7 +145,7 @@ public function testShouldConvertClientMessageToTransportMessage()
141
145
142
146
$ context = $ this ->createPsrContextMock ();
143
147
$ context
144
- ->expects ($ this ->once ( ))
148
+ ->expects ($ this ->exactly ( 2 ))
145
149
->method ('createMessage ' )
146
150
->willReturn (new SqsMessage ())
147
151
;
@@ -171,6 +175,12 @@ public function testShouldConvertClientMessageToTransportMessage()
171
175
$ this ->assertSame (1000 , $ transportMessage ->getTimestamp ());
172
176
$ this ->assertSame ('theReplyTo ' , $ transportMessage ->getReplyTo ());
173
177
$ this ->assertSame ('theCorrelationId ' , $ transportMessage ->getCorrelationId ());
178
+ $ this ->assertSame (0 , $ transportMessage ->getDelaySeconds ());
179
+
180
+ // Test delay
181
+ $ clientMessage ->setDelay (100 );
182
+ $ transportMessage = $ driver ->createTransportMessage ($ clientMessage );
183
+ $ this ->assertSame (100 , $ transportMessage ->getDelaySeconds ());
174
184
}
175
185
176
186
public function testShouldSendMessageToRouterQueue ()
0 commit comments