/**
  * @test
  */
 public function shouldSentNackSignal()
 {
     // Create message
     $message = $this->queueTemplate->createMessage(['msg' => 'blaat']);
     $message->delivery_info = ['channel' => $this->queueTemplate->channel(), 'delivery_tag' => 123];
     // Create a failing consumer instance. This instance will return false. A nack signal should be sent.
     $consumer = new CleanFailConsumer($this->queueTemplate);
     // Execute consumer
     call_user_func($consumer, $message);
     // Assert that the ack signal was sent
     $this->assertEquals(1, $this->basicNackInvocations->getInvocationCount());
     // Create a failing consumer instance. This instance will return false. A nack signal should be sent.
     $consumer = new FailWithExceptionConsumer($this->queueTemplate);
     // Execute consumer
     try {
         call_user_func($consumer, $message);
     } catch (\Exception $e) {
         // Make sure no exception is thrown here.
     }
     // Assert that the ack signal was sent
     $this->assertEquals(1, $this->basicNackInvocations->getInvocationCount());
 }