/** * Generate a resumption token to continue the current operation. * * @param SimpleXMLElement $xml XML document to update with token. * @param array $params Current operational parameters. * @param int $currentCursor Current cursor position in search * results. * @param int $listSize Total size of search results. * * @return void */ protected function saveResumptionToken($xml, $params, $currentCursor, $listSize) { // Save the old cursor position before overwriting it for storage in the // database! $oldCursor = $params['cursor']; $params['cursor'] = $currentCursor; // Save everything to the database: $search = $this->tableManager->get('OaiResumption'); $expire = time() + 24 * 60 * 60; $token = $search->saveToken($params, $expire); // Add details to the xml: $token = $xml->addChild('resumptionToken', $token); $token->addAttribute('cursor', $oldCursor); $token->addAttribute('expirationDate', date($this->iso8601, $expire)); $token->addAttribute('completeListSize', $listSize); }
/** * Test expected interface. * * @return void * * @expectedException Zend\ServiceManager\Exception\RuntimeException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Db\Table\Gateway */ public function testExpectedInterface() { $pm = new PluginManager(null); $pm->validatePlugin(new \ArrayObject()); }