Check if a queue/tube has a given current number of messages

```php
<?php
$I->seeQueueHasCurrentCount('default', 10);
?>
```

@param string $queue Queue Name
@param int $expected Number of messages expected
546056
public function seeQueueHasCurrentCount($queue, $expected)
    {
        $this->assertEquals($expected, $this->queueDriver->getMessagesCurrentCountOnQueue($queue));
    }
298253
public function isQueueOnline($queue)
    {
        if ($queue->alert_heartbeat_greater_than < 1) {
            return true;
        }

        if (Carbon::now()->diffInSeconds($queue->last_heartbeat) <= $queue->alert_heartbeat_greater_than) {
            if ($this->eye->status()->isSick('queue_online_'.$queue->id)) {
                $this->eye->notifier()->alert(new Online(['queue' => $queue]));
            }

            $this->eye->status()->setHealthy('queue_online_'.$queue->id);

            return true;
        }

        if ($this->eye->status()->isHealthy('queue_online_'.$queue->id)) {
            $this->eye->notifier()->alert(new Offline(['queue' => $queue]));
        }

        $this->eye->status()->setSick('queue_online_'.$queue->id);

        return false;
    }
93559
private function message(string $expectedRowCount, int $actualRowCount, string $query): string
  {
    $query = trim($query);

    $message = 'Wrong number of rows selected.';
    $message .= "\n";
    $message .= sprintf("Expected number of rows: %s.\n", $expectedRowCount);
    $message .= sprintf("Actual number of rows: %s.\n", $actualRowCount);
    $message .= 'Query:';
    $message .= (strpos($query, "\n")!==false) ? "\n" : ' ';
    $message .= $query;

    return $message;
  }
291112
public function setQueueOptions(array $options = [], $queue = self::PRIORITY_NORM)
    {
        msg_set_queue($this->queues[$queue], $options);
    }
387321
public function count(ZendQueue $queue = null)
    {
        if ($queue === null) {
            $queue = $this->_queue;
        }
        $queueName = $queue->getName();
        $queueId = $this->getQueueId($queueName);
        $count = $this->db->fetchColumn('select count(*) from QueueMessages where queue_id = ?', [$queueId]);

        return (int) $count;
    }
407275
private function searchForExecutionsCount(Expectation $expectation)
    {
        $count = 0;
        foreach ($this->requestsStorage->listRequests() as $request) {
            if ($this->comparator->equals($request, $expectation)) {
                ++$count;
            }
        }

        return $count;
    }
146347
public function seeInEmailHtmlBody($expected)
    {
        $email = $this->fetchLastMessage();
        $this->assertContains($expected, $email->html_body, 'Email body contains HTML');
    }
11231
public function getCurrentMessageCount()
    {
        // Save the current queue flags and setup the queue in passive mode
        $flags = $this->queue->getFlags();
        $this->queue->setFlags($flags | AMQP_PASSIVE);

        // Declare the queue again as passive to get the count of messages
        $messagesCount = $this->queue->declareQueue();

        // Restore the queue flags
        $this->queue->setFlags($flags);

        return $messagesCount;
    }
580083
public function addMessageToQueue($message, $queue)
    {
        $this->queue->sendMessage([
            'QueueUrl' => $this->getQueueURL($queue),
            'MessageBody' => $message,
        ]);
    }
83008
public function seeQueueHasTotalCount($queue, $expected)
    {
        $this->assertEquals($expected, $this->queueDriver->getMessagesTotalCountOnQueue($queue));
    }
757267
protected function assertMailCount($actualMail, $expectedCount = null)
    {
        $actualCount = count($actualMail);
        if (is_null($expectedCount)) {
            // If number to expect is not specified, expect more than zero.
            if ($actualCount === 0) {
                throw new \Exception("Expected some mail, but none found.");
            }
        } else {
            if ($expectedCount != $actualCount) {
                // Prepare a simple list of actual mail.
                $prettyActualMail = [];
                foreach ($actualMail as $singleActualMail) {
                    $prettyActualMail[] = [
                    'to' => $singleActualMail['to'],
                    'subject' => $singleActualMail['subject'],
                    ];
                }
                throw new \Exception(sprintf("Expected %s mail, but %s found:\n\n%s", $expectedCount, $actualCount, print_r($prettyActualMail, true)));
            }
        }
    }
962392
static function assertEqualIterable(iterable $expected, $actual, string $message = ''): void
    {
        static::assertThat($actual, static::equalIterable($expected), $message);
    }
162084
public function seeEmailIsSent($expectedCount = null)
    {
        $profile = $this->getProfile();
        if (!$profile) {
            $this->fail('Emails can\'t be tested without Profiler');
        }
        if (!$profile->hasCollector('swiftmailer')) {
            $this->fail('Emails can\'t be tested without SwiftMailer connector');
        }

        if (!is_int($expectedCount) && !is_null($expectedCount)) {
            $this->fail(sprintf(
                'The required number of emails must be either an integer or null. "%s" was provided.',
                print_r($expectedCount, true)
            ));
        }

        $realCount = $profile->getCollector('swiftmailer')->getMessageCount();
        if ($expectedCount === null) {
            $this->assertGreaterThan(0, $realCount);
        } else {
            $this->assertEquals(
                $expectedCount,
                $realCount,
                sprintf(
                    'Expected number of sent emails was %d, but in reality %d %s sent.',
                    $expectedCount,
                    $realCount,
                    $realCount === 2 ? 'was' : 'were'
                )
            );
        }
    }
794924
public function incrementQueue($queue, $runtime)
    {
        $this->connection()->eval(LuaScripts::updateMetrics(), 2,
            'queue:'.$queue, 'measured_queues', str_replace(',', '.', $runtime)
        );
    }
874915
public function runNextJob($queue, Structure $options)
    {
        $message = $this->getNextMessage($queue);

        if (!$message) {
            return;
        }

        $this->process($message, $options);
    }
1237100
public function queue_delete($queue = '', $if_unused = false, $if_empty = false, $nowait = false, $ticket = null)
    {
        $ticket = $this->getTicket($ticket);

        list($class_id, $method_id, $args) = $this->protocolWriter->queueDelete(
            $ticket,
            $queue,
            $if_unused,
            $if_empty,
            $nowait
        );

        $this->send_method_frame(array($class_id, $method_id), $args);

        if ($nowait) {
            return null;
        }

        return $this->wait(array(
            $this->waitHelper->get_wait('queue.delete_ok')
        ), false, $this->channel_rpc_timeout);
    }
91643
public function size($queue = null)
    {
        return $this->database->table($this->table)
                    ->where('queue', $this->getQueue($queue))
                    ->count();
    }