예제 #1
0
 public function testBasicIteration()
 {
     $uri = 'http://localhost';
     $args = array('from' => '2012-01-01', 'until' => '2012-01-02', 'set' => 'Dummy');
     $n = 8;
     $responses = array($response = $this->makeDummyResponse($n, 1, false, $args));
     $http = $this->httpMockListResponse($responses);
     // $http = $this->httpMockSingleResponse($response);
     $client = new Client($uri, null, $http);
     $records = new Records($args['from'], $args['until'], $args['set'], $client);
     $this->assertEquals(8, $records->numberOfRecords);
     $records->rewind();
     $this->assertEquals(1, $records->key());
     $this->assertTrue($records->valid());
     $records->next();
     $records->next();
     $this->assertEquals(3, $records->key());
     $this->assertTrue($records->valid());
 }