Basho\Tests\SecondaryIndexOperationsTest::testReturnTerms PHP Method

testReturnTerms() public method

public testReturnTerms ( )
    public function testReturnTerms()
    {
        $keysAndTerms = [['A' => 'student0'], ['B' => 'student1'], ['A' => 'student6'], ['B' => 'student7']];
        $command = (new Command\Builder\QueryIndex(static::$riak))->buildBucket('Students' . static::$bucket, static::LEVELDB_BUCKET_TYPE)->withIndexName('grade_bin')->withRangeValue('A', 'B')->withReturnTerms(true)->build();
        $response = $command->execute();
        $this->assertEquals('200', $response->getCode());
        $matches = $response->getResults();
        usort($matches, function ($a, $b) {
            return strnatcmp(current($a), current($b));
        });
        $this->assertEquals(334, count($matches));
        $this->assertTrue($response->hasReturnTerms());
        $this->assertEquals($keysAndTerms, array_slice($matches, 0, 4));
    }