Passed
Pull Request — master (#36)
by
unknown
15:58 queued 07:42
created
Tests/RabbitMq/ConsumerTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         $amqpChannel = $this->prepareAMQPChannel();
51 51
         $consumer = $this->getConsumer($amqpConnection, $amqpChannel);
52 52
 
53
-        $callbackFunction = function () use ($processFlag) {
53
+        $callbackFunction = function() use ($processFlag) {
54 54
             return $processFlag;
55 55
         }; // Create a callback function with a return value set by the data provider.
56 56
         $consumer->setCallback($callbackFunction);
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
         if ($expectedMethod) {
64 64
             $amqpChannel->expects($this->any())
65 65
                 ->method('basic_reject')
66
-                ->will($this->returnCallback(function ($delivery_tag, $requeue) use ($expectedMethod, $expectedRequeue) {
66
+                ->will($this->returnCallback(function($delivery_tag, $requeue) use ($expectedMethod, $expectedRequeue) {
67 67
                     Assert::assertSame($expectedMethod, 'basic_reject'); // Check if this function should be called.
68 68
                     Assert::assertSame($requeue, $expectedRequeue); // Check if the message should be requeued.
69 69
                 }));
70 70
 
71 71
             $amqpChannel->expects($this->any())
72 72
                 ->method('basic_ack')
73
-                ->will($this->returnCallback(function ($delivery_tag) use ($expectedMethod) {
73
+                ->will($this->returnCallback(function($delivery_tag) use ($expectedMethod) {
74 74
                     Assert::assertSame($expectedMethod, 'basic_ack'); // Check if this function should be called.
75 75
                 }));
76 76
         } else {
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             ->with(null, false, $consumer->getIdleTimeout())
176 176
             ->will(
177 177
                 $this->returnCallback(
178
-                    function () use ($amqpChannel) {
178
+                    function() use ($amqpChannel) {
179 179
                         /** remove an element on each loop like ... simulate an ACK */
180 180
                         array_splice($amqpChannel->callbacks, 0, 1);
181 181
                     })
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         $amqpChannel->expects($this->exactly(1))
222 222
             ->method('wait')
223 223
             ->with(null, false, $consumer->getIdleTimeout())
224
-            ->willReturnCallback(function ($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) {
224
+            ->willReturnCallback(function($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) {
225 225
                 // simulate time passing by moving the last activity date time
226 226
                 $consumer->setLastActivityDateTime(new \DateTime("-$waitTimeout seconds"));
227 227
                 throw new AMQPTimeoutException();
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         $amqpChannel->expects($this->exactly(2))
257 257
             ->method('wait')
258 258
             ->with(null, false, $consumer->getIdleTimeout())
259
-            ->willReturnCallback(function ($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) {
259
+            ->willReturnCallback(function($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) {
260 260
                 // simulate time passing by moving the last activity date time
261 261
                 $consumer->setLastActivityDateTime(new \DateTime("-$waitTimeout seconds"));
262 262
                 throw new AMQPTimeoutException();
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         $eventDispatcher->expects($this->at(1))
270 270
             ->method('dispatch')
271 271
             ->with($this->isInstanceOf(OnIdleEvent::class), OnIdleEvent::NAME)
272
-            ->willReturnCallback(function (OnIdleEvent $event, $eventName) {
272
+            ->willReturnCallback(function(OnIdleEvent $event, $eventName) {
273 273
                 $event->setForceStop(false);
274 274
 
275 275
                 return $event;
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
         $eventDispatcher->expects($this->at(3))
279 279
             ->method('dispatch')
280 280
             ->with($this->isInstanceOf(OnIdleEvent::class), OnIdleEvent::NAME)
281
-            ->willReturnCallback(function (OnIdleEvent $event, $eventName) {
281
+            ->willReturnCallback(function(OnIdleEvent $event, $eventName) {
282 282
                 $event->setForceStop(true);
283 283
 
284 284
                 return $event;
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 
318 318
         $amqpChannel->expects($this->exactly(1))
319 319
             ->method('wait')
320
-            ->willReturnCallback(function ($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) {
320
+            ->willReturnCallback(function($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) {
321 321
                 // simulate time passing by moving the max execution date time
322 322
                 $consumer->setGracefulMaxExecutionDateTimeFromSecondsInTheFuture($waitTimeout * -1);
323 323
                 throw new AMQPTimeoutException();
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
         $amqpChannel->expects($this->exactly(2))
386 386
             ->method('wait')
387 387
             ->with(null, false, 30)
388
-            ->willReturnCallback(function ($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) {
388
+            ->willReturnCallback(function($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) {
389 389
                 // ensure max execution date time "counts down"
390 390
                 $consumer->setGracefulMaxExecutionDateTime(
391 391
                     $consumer->getGracefulMaxExecutionDateTime()->modify("-$waitTimeout seconds")
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
         $amqpChannel->expects($this->once())
427 427
             ->method('wait')
428 428
             ->with(null, false, 10)
429
-            ->willReturnCallback(function ($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) {
429
+            ->willReturnCallback(function($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) {
430 430
                 // simulate time passing by moving the max execution date time
431 431
                 $consumer->setGracefulMaxExecutionDateTimeFromSecondsInTheFuture($waitTimeout * -1);
432 432
                 throw new AMQPTimeoutException();
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
         $amqpChannel->expects($this->once())
465 465
             ->method('wait')
466 466
             ->with(null, false, 10)
467
-            ->willReturnCallback(function ($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) {
467
+            ->willReturnCallback(function($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) {
468 468
                 // simulate time passing by moving the last activity date time
469 469
                 $consumer->setLastActivityDateTime(new \DateTime("-$waitTimeout seconds"));
470 470
                 throw new AMQPTimeoutException();
Please login to merge, or discard this patch.