/**
  * @dataProvider getDataForPageSizeTest
  */
 public function testPrepareRequestSetsPageSizeCorrectly($limitParam, $limit, $pageSize, $resultingLimit)
 {
     $command = $this->getMockedCommand();
     if ($limit) {
         $command->set($limitParam, $limit);
     }
     $iterator = new AwsResourceIterator($command, array('limit_param' => $limitParam));
     if ($pageSize) {
         $iterator->setPageSize($pageSize);
     }
     $property = new \ReflectionProperty($iterator, 'command');
     $property->setAccessible(true);
     $property->setValue($iterator, $command);
     $prepareRequest = new \ReflectionMethod($iterator, 'prepareRequest');
     $prepareRequest->setAccessible(true);
     $prepareRequest->invoke($iterator);
     $this->assertEquals($resultingLimit, $command->get($limitParam));
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 protected function handleResults(Model $result)
 {
     $this->scannedCount += (int) $result->get('ScannedCount');
     return parent::handleResults($result);
 }