Ejemplo n.º 1
0
 public function testGetCurPage()
 {
     $this->_model->setCurPage(10);
     $this->assertEquals(1, $this->_model->getCurPage());
 }
Ejemplo n.º 2
0
 /**
  * Set collection for pagination
  *
  * @param  \Magento\Framework\Data\Collection $collection
  * @return $this
  */
 public function setCollection($collection)
 {
     $this->_collection = $collection->setCurPage($this->getCurrentPage());
     // If not int - then not limit
     if ((int) $this->getLimit()) {
         $this->_collection->setPageSize($this->getLimit());
     }
     $this->_setFrameInitialized(false);
     return $this;
 }