Ejemplo n.º 1
0
 /**
  * @param    int        item count
  * @return   void
  */
 public function setItemCount($count)
 {
     parent::setItemCount($count);
     $this->buildItemOffset();
 }
Ejemplo n.º 2
0
 /**
  * @depends  testInit
  * @param    IteratorDecoratorLimit
  * @return   void
  */
 public function testIterationWithOffset2(IteratorDecoratorLimit $iteratorLimitObject)
 {
     $iteratorLimitObject->setItemOffset(20);
     $iteratorLimitObject->setItemCount(10);
     $this->assertEquals(20, $iteratorLimitObject->getItemOffset());
     $this->assertEquals(10, $iteratorLimitObject->getItemCount());
     $this->assertEquals(1, count($iteratorLimitObject));
     $array = array();
     foreach ($iteratorLimitObject as $key => $value) {
         $array[] = $value;
     }
     $this->assertEquals(1, count($array));
     $this->assertEquals(21, $array[0]);
 }