/** * Get mock search results * * @param int $page Current page number * @param int $limit Page size * @param int $total Total size of fake result set * * @return \VuFind\Search\Base\Results */ protected function getMockResults($page = 1, $limit = 20, $total = 0) { $pm = $this->getMockBuilder('VuFind\\Config\\PluginManager')->disableOriginalConstructor()->getMock(); $options = new \VuFindTest\Search\TestHarness\Options($pm); $params = new \VuFindTest\Search\TestHarness\Params($options, $pm); $params->setPage($page); $params->setLimit($limit); $results = new \VuFindTest\Search\TestHarness\Results($params, $total); return $results; }
/** * Get mock search results * * @param int $page Current page number * @param int $limit Page size * @param int $total Total size of fake result set * @param bool $firstLast Turn on first/last config? * * @return \VuFind\Search\Base\Results */ protected function getMockResults($page = 1, $limit = 20, $total = 0, $firstLast = true) { $pm = $this->getMockBuilder('VuFind\\Config\\PluginManager')->disableOriginalConstructor()->getMock(); $config = new \Zend\Config\Config($firstLast ? $this->getFirstLastConfig() : []); $pm->expects($this->any())->method('get')->will($this->returnValue($config)); $options = new \VuFindTest\Search\TestHarness\Options($pm); $params = new \VuFindTest\Search\TestHarness\Params($options, $pm); $params->setPage($page); $params->setLimit($limit); $results = new \VuFindTest\Search\TestHarness\Results($params, $total); return $results; }