/** * @dataProvider getOffsets * * @param int $max_navigate * @param int $current_page * @param int $total_pages * @param int $left_offset * @param int $right_offset */ public function testBuildOffset($max_navigate, $current_page, $total_pages, $left_offset, $right_offset) { $this->config->expects($this->exactly(2))->method('getMaxNavigate')->will($this->returnValue($max_navigate)); $this->config->expects($this->atLeastOnce())->method('getCurrentPage')->will($this->returnValue($current_page)); $this->config->expects($this->atLeastOnce())->method('getTotalPages')->will($this->returnValue($total_pages)); $this->assertEquals($left_offset, $this->range->getLeftOffset()); $this->assertEquals($right_offset, $this->range->getRightOffset()); }
public function testGetIteratorEmpty() { $this->config->expects($this->once())->method('getTotalPages')->will($this->returnValue(1)); $this->config->expects($this->never())->method('getCurrentPage'); $this->config->expects($this->never())->method('getPageLink'); $this->config->expects($this->never())->method('getFirstPageLink'); $this->range->expects($this->never())->method('getLeftOffset'); $this->range->expects($this->never())->method('getRightOffset'); $this->assertEquals(new ArrayCollection(), $this->view->getIterator()); }