@@ -91,8 +91,6 @@ public function testShouldConvertTransportMessageToClientMessage()
9191 $ transportMessage ->setTimestamp (1000 );
9292 $ transportMessage ->setReplyTo ('theReplyTo ' );
9393 $ transportMessage ->setCorrelationId ('theCorrelationId ' );
94- $ transportMessage ->setReplyTo ('theReplyTo ' );
95- $ transportMessage ->setCorrelationId ('theCorrelationId ' );
9694
9795 $ driver = new SqsDriver (
9896 $ this ->createPsrContextMock (),
@@ -120,9 +118,15 @@ public function testShouldConvertTransportMessageToClientMessage()
120118 $ this ->assertSame (1000 , $ clientMessage ->getTimestamp ());
121119 $ this ->assertSame ('theReplyTo ' , $ clientMessage ->getReplyTo ());
122120 $ this ->assertSame ('theCorrelationId ' , $ clientMessage ->getCorrelationId ());
121+ $ this ->assertNull ($ clientMessage ->getDelay ());
123122
124123 $ this ->assertNull ($ clientMessage ->getExpire ());
125124 $ 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 ());
126130 }
127131
128132 public function testShouldConvertClientMessageToTransportMessage ()
@@ -141,7 +145,7 @@ public function testShouldConvertClientMessageToTransportMessage()
141145
142146 $ context = $ this ->createPsrContextMock ();
143147 $ context
144- ->expects ($ this ->once ( ))
148+ ->expects ($ this ->exactly ( 2 ))
145149 ->method ('createMessage ' )
146150 ->willReturn (new SqsMessage ())
147151 ;
@@ -171,6 +175,12 @@ public function testShouldConvertClientMessageToTransportMessage()
171175 $ this ->assertSame (1000 , $ transportMessage ->getTimestamp ());
172176 $ this ->assertSame ('theReplyTo ' , $ transportMessage ->getReplyTo ());
173177 $ 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 ());
174184 }
175185
176186 public function testShouldSendMessageToRouterQueue ()
0 commit comments