Esempio n. 1
0
 public function testGetPagerHtml()
 {
     $limit = 10;
     $this->layout->expects($this->once())->method('getChildName')->will($this->returnValue('product_list_toolbar_pager'));
     $this->layout->expects($this->once())->method('getBlock')->will($this->returnValue($this->pagerBlock));
     $this->productListHelper->expects($this->exactly(2))->method('getAvailableLimit')->will($this->returnValue([10 => 10, 20 => 20]));
     $this->model->expects($this->once())->method('getLimit')->will($this->returnValue($limit));
     $this->pagerBlock->expects($this->once())->method('setUseContainer')->will($this->returnValue($this->pagerBlock));
     $this->pagerBlock->expects($this->once())->method('setShowPerPage')->will($this->returnValue($this->pagerBlock));
     $this->pagerBlock->expects($this->once())->method('setShowAmounts')->will($this->returnValue($this->pagerBlock));
     $this->pagerBlock->expects($this->once())->method('setFrameLength')->will($this->returnValue($this->pagerBlock));
     $this->pagerBlock->expects($this->once())->method('setJump')->will($this->returnValue($this->pagerBlock));
     $this->pagerBlock->expects($this->once())->method('setLimit')->with($limit)->will($this->returnValue($this->pagerBlock));
     $this->pagerBlock->expects($this->once())->method('setCollection')->will($this->returnValue($this->pagerBlock));
     $this->pagerBlock->expects($this->once())->method('toHtml')->will($this->returnValue(true));
     $this->assertTrue($this->block->getPagerHtml());
 }