Google\Cloud\Tests\PubSub\SubscriptionTest::testAcknowledgeBatch PHP Method

testAcknowledgeBatch() public method

    public function testAcknowledgeBatch()
    {
        $ackIds = ['foobar', 'otherAckId'];
        $messages = [];
        foreach ($ackIds as $id) {
            $messages[] = new Message([], ['ackId' => $id]);
        }
        $this->connection->acknowledge(Argument::that(function ($args) use($ackIds) {
            if ($args['foo'] !== 'bar') {
                return false;
            }
            if ($args['ackIds'] !== $ackIds) {
                return false;
            }
            return true;
        }))->shouldBeCalledTimes(1);
        $this->subscription->setConnection($this->connection->reveal());
        $this->subscription->acknowledgeBatch($messages, ['foo' => 'bar']);
    }