/**
  * @Then the queue :queueName should contain task :taskName
  *
  * @param $queueName
  * @param $taskName
  * @return bool
  */
 public function thenQueueShouldContainTask($queueName, $taskName)
 {
     $queue = $this->createQueue($queueName);
     /** @var Envelope $envelope */
     foreach ($queue->peek() as $envelope) {
         if ($taskName === $envelope->getName()) {
             Assertions::assertEquals($taskName, $envelope->getName());
             return true;
         }
     }
     Assertions::fail(sprintf('No task with name %s was found in the queue: %s', $taskName, $queueName));
     return false;
 }
 /**
  * @Then /^it should match the following properties:$/
  */
 public function itShouldMatchTheFollowingProperties(TableNode $table)
 {
     $jsonString = $this->getClient()->lastResponseBody;
     Assertions::assertJson($jsonString);
     $json = json_decode($jsonString, true);
     foreach ($table->getRows() as list($key, $value)) {
         // So we can detect checks for null values
         $value = $value === 'null' ? null : $value;
         Assertions::assertArrayHasKey($key, $json);
         if (is_bool($json[$key])) {
             Assertions::assertEquals((bool) $value, $json[$key]);
         } else {
             Assertions::assertEquals($value, $json[$key]);
         }
     }
 }