public function testSetPaginationFromQuery() { $query = $this->getMock('SQLSelect'); $query->expects($this->once())->method('getLimit')->will($this->returnValue(array('limit' => 15, 'start' => 30))); $query->expects($this->once())->method('unlimitedRowCount')->will($this->returnValue(100)); $list = new PaginatedList(new ArrayList()); $list->setPaginationFromQuery($query); $this->assertEquals(15, $list->getPageLength()); $this->assertEquals(30, $list->getPageStart()); $this->assertEquals(100, $list->getTotalItems()); }