@@ -34,15 +34,6 @@ public function testCouldBeConstructedWithExpectedArguments()
3434 new RabbitMQQueue ($ this ->createAmqpContext (), $ this ->createDummyConfig ());
3535 }
3636
37- public function testShouldAllowSetAttempts ()
38- {
39- $ queue = new RabbitMQQueue ($ this ->createAmqpContext (), $ this ->createDummyConfig ());
40-
41- $ queue ->setAttempts (123 );
42-
43- $ this ->assertAttributeSame (123 , 'retryAfter ' , $ queue );
44- }
45-
4637 public function testShouldGenerateNewCorrelationIdIfNotSet ()
4738 {
4839 $ queue = new RabbitMQQueue ($ this ->createAmqpContext (), $ this ->createDummyConfig ());
@@ -128,7 +119,7 @@ public function testShouldSendExpectedMessageOnPushRaw()
128119 $ this ->assertSame ('application/json ' , $ message ->getContentType ());
129120 $ this ->assertSame (AmqpMessage::DELIVERY_MODE_PERSISTENT , $ message ->getDeliveryMode ());
130121 $ this ->assertNotEmpty ($ message ->getCorrelationId ());
131- $ this ->assertNull ($ message ->getProperty (RabbitMQQueue ::ATTEMPT_COUNT_HEADERS_KEY ));
122+ $ this ->assertNull ($ message ->getProperty (RabbitMQJob ::ATTEMPT_COUNT_HEADERS_KEY ));
132123 })
133124 ;
134125 $ producer
@@ -167,7 +158,7 @@ public function testShouldSendExpectedMessageOnPushRaw()
167158 $ queue ->pushRaw ('thePayload ' , $ expectedQueueName );
168159 }
169160
170- public function testShouldSetAttemptCountHeaderIfNotNull ()
161+ public function testShouldSetAttemptCountPropIfNotNull ()
171162 {
172163 $ expectedAttempts = 54321 ;
173164
@@ -179,7 +170,7 @@ public function testShouldSetAttemptCountHeaderIfNotNull()
179170 ->method ('send ' )
180171 ->with ($ this ->identicalTo ($ topic ), $ this ->isInstanceOf (AmqpMessage::class))
181172 ->willReturnCallback (function ($ actualTopic , AmqpMessage $ message ) use ($ expectedAttempts ) {
182- $ this ->assertSame ($ expectedAttempts , $ message ->getProperty (RabbitMQQueue ::ATTEMPT_COUNT_HEADERS_KEY ));
173+ $ this ->assertSame ($ expectedAttempts , $ message ->getProperty (RabbitMQJob ::ATTEMPT_COUNT_HEADERS_KEY ));
183174 })
184175 ;
185176 $ producer
@@ -212,9 +203,8 @@ public function testShouldSetAttemptCountHeaderIfNotNull()
212203
213204 $ queue = new RabbitMQQueue ($ context , $ this ->createDummyConfig ());
214205 $ queue ->setContainer ($ this ->createDummyContainer ());
215- $ queue ->setAttempts ($ expectedAttempts );
216206
217- $ queue ->pushRaw ('thePayload ' , 'aQueue ' );
207+ $ queue ->pushRaw ('thePayload ' , 'aQueue ' , [ ' attempts ' => $ expectedAttempts ] );
218208 }
219209
220210 public function testShouldSetDeliveryDelayIfDelayOptionPresent ()
0 commit comments