Basho\Tests\SecondaryIndexOperationsTest::testGettingKeysWithContinuationWorks PHP Method

testGettingKeysWithContinuationWorks() public method

    public function testGettingKeysWithContinuationWorks()
    {
        $builder = (new Command\Builder\QueryIndex(static::$riak))->buildBucket('Students' . static::$bucket, static::LEVELDB_BUCKET_TYPE)->withIndexName('lucky_numbers_int')->withRangeValue(0, 3)->withMaxResults(3);
        // Get first page
        $command = $builder->build();
        $response = $command->execute();
        $this->assertEquals('200', $response->getCode());
        $this->assertEquals(3, count($response->getResults()));
        $this->assertNotNull($response->getContinuation());
        $this->assertFalse($response->isDone());
        // Get second page
        $builder = $builder->withContinuation($response->getContinuation());
        $command2 = $builder->build();
        $response2 = $command2->execute();
        $this->assertEquals('200', $response2->getCode());
        $this->assertEquals(1, count($response2->getResults()));
        $this->assertNull($response2->getContinuation());
        $this->assertTrue($response2->isDone());
    }