Skip to content
Snippets Groups Projects
Commit 8ba0817b authored by llaffont's avatar llaffont
Browse files

Dynix: récupération localisation + code barres des exemplaires

parent ab5301b8
No related merge requests found
......@@ -20,9 +20,29 @@
*/
class Class_WebService_SIGB_Dynix_TitleInfoResponseReader extends Class_WebService_SIGB_AbstractXMLNoticeReader {
protected $_current_code_annexe;
protected $_current_exemplaire;
public function endTitleId($content) {
$this->_notice = new Class_WebService_SIGB_Notice($content);
}
public function endLibraryId($data) {
$this->_current_code_annexe = $data;
}
public function endItemId($content) {
$this->_current_exemplaire = (new Class_WebService_SIGB_Exemplaire($content))->setCodeBarre($content);
$this->_notice->addExemplaire($this->_current_exemplaire);
}
public function endCallInfo() {
$this->_current_exemplaire->setCodeAnnexe($this->_current_code_annexe);
}
}
?>
\ No newline at end of file
......@@ -83,6 +83,43 @@ class DynixGetNoticeLeCombatOrdinaire extends DynixTestCase {
public function shouldAnswerANotice() {
$this->assertInstanceOf('Class_WebService_SIGB_Notice', $this->_notice);
}
/** @test */
public function noticeIdShouldBe233823() {
$this->assertEquals(233823, $this->_notice->getId());
}
/** @test */
public function getExemplairesShouldReturnAnArrayWithSizeTwo() {
$this->assertEquals(2, count($this->_notice->getExemplaires()));
}
/** @test */
public function firstExemplaireIdShouldBe39410001517933() {
$this->assertEquals('39410001517933', $this->_notice->exemplaireAt(0)->getId());
}
/** @test */
public function firstCodeBarresShouldBe39410001517933() {
$this->assertEquals('39410001517933', $this->_notice->exemplaireAt(0)->getCodeBarre());
}
/** @test */
public function firstExemplaireCodeAnnexeShouldBeALFMEDA() {
$this->assertEquals('ALFMEDA', $this->_notice->exemplaireAt(0)->getCodeAnnexe());
}
/** @test */
public function secondExemplaireCodeAnnexeShouldBeALFAX1() {
$this->assertEquals('ALFAX1', $this->_notice->exemplaireAt(1)->getCodeAnnexe());
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment