예제 #1
0
 public function testRewindCausesANewRequest()
 {
     $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), $response = $this->makeDummyResponse($n, 1, false, $args), $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);
     $records->next();
     $records->rewind();
     $records->next();
     $i = 0;
     foreach ($records as $rec) {
         $i++;
     }
     $this->assertEquals($n, $i);
 }