Beispiel #1
0
 /**
  * Returns an array of items for a page.
  *
  * @param  integer $offset Page offset
  * @param  integer $itemCountPerPage Number of items per page
  * @return array
  */
 public function getItems($offset, $itemCountPerPage)
 {
     $data = parent::getItems($offset, $itemCountPerPage);
     $return = array();
     $rowsetConfig = array('rowClass' => $this->_rowClass, 'data' => $data);
     $rowset = new Zend_Db_Table_Rowset($rowsetConfig);
     return $rowset;
 }
Beispiel #2
0
 /**
  * @group ZF-4151
  */
 public function testEmptySet()
 {
     $this->_adapter = new Adapter\ArrayAdapter(array());
     $actual = $this->_adapter->getItems(0, 10);
     $this->assertEquals(array(), $actual);
 }
Beispiel #3
0
 /**
  * Verify that the fix for ZF-4151 doesn't create an OBO error
  */
 public function testSetOfOne()
 {
     $this->_adapter = new Zend_Paginator_Adapter_Null(1);
     $actual = $this->_adapter->getItems(0, 10);
     $this->assertEquals(array_fill(0, 1, null), $actual);
 }
Beispiel #4
0
 /**
  * @group ZF-4151
  */
 public function testEmptySet()
 {
     $this->_adapter = new Zend_Paginator_Adapter_Array(array());
     $actual = $this->_adapter->getItems(0, 10);
     $this->assertEquals(array(), $actual);
 }
Beispiel #5
0
 public function testReturnsCorrectCount()
 {
     $this->assertEquals(101, $this->_adapter->count());
 }