protected function getNthrecord($n) { $response = new XmlImporter('tests/data/sru-alma.xml'); $collection = $response->getCollection(); $records = $collection->records; foreach (range(1, $n) as $i) { $records->next(); } return $records->current(); }
public function fromString($data) { $isXml = substr($data, 0, 1) == '<'; if ($isXml) { $importer = new XmlImporter($data); return $importer->getCollection(); } else { $parser = $this->factory->make('File_MARC', $data, File_MARC::SOURCE_STRING); return new Collection($parser); } }
public function getCollection() { $isXml = substr($this->data, 0, 1) == '<'; if ($isXml) { $importer = new XmlImporter($this->data); return $importer->getCollection(); } else { $c = new Collection(); $c->parse($this->data, false); return $c; } }
public static function fromOaiPmhResponse($data) { $importer = new XmlImporter($data); return $importer->getCollection(); }
public function testBibsysSample() { $response = new XmlImporter('tests/data/oaipmh-bibsys.xml'); $this->assertCount(89, $response->getRecords()); }
public function testEmptySet() { $response = new XmlImporter('<records></records>'); $this->assertCount(0, $response->getCollection()->records); }
public function testAlmaSample() { $response = new XmlImporter('tests/data/sru-alma.xml'); $this->assertCount(3, $response->getRecords()); }