Cassandra\PagingIntegrationTest::testPagingToken PHP Method

testPagingToken() public method

This test ensure that the paging state token is properly returned and can be used to get the next page results.
public testPagingToken ( )
    public function testPagingToken()
    {
        $results = array();
        $statement = new SimpleStatement("SELECT * FROM {$this->tableNamePrefix}");
        for ($i = 0; $i < 10; $i++) {
            $options = array("page_size" => 1);
            if (isset($result)) {
                $options["paging_state_token"] = $result->pagingStateToken();
            }
            $result = $this->session->execute($statement, new ExecutionOptions($options));
            $this->assertEquals(1, count($result));
            $row = $result->first();
            $results[] = $row["value"];
        }
        sort($results);
        $this->assertEquals($results, range(0, 9));
    }