public function testUsingPaginationSortWillSortResultsWhilePaging()
{
$builder = (new Command\Builder\QueryIndex(static::$riak))->buildBucket('Students' . static::$bucket, static::LEVELDB_BUCKET_TYPE)->withIndexName('lucky_numbers_int')->withRangeValue(0, 500)->withMaxResults(10)->withReturnTerms(true);
// Get first page
$command = $builder->build();
$response = $command->execute();
$this->assertEquals('200', $response->getCode());
$this->assertEquals(['0' => 'student0'], $response->getResults()[0]);
// Get second page
$builder = $builder->withContinuation($response->getContinuation());
$command2 = $builder->build();
$response2 = $command2->execute();
$this->assertEquals('200', $response2->getCode());
$this->assertEquals(10, count($response2->getResults()));
$this->assertEquals(['10' => 'student10'], $response2->getResults()[0]);
}