Skip to content
Snippets Groups Projects
Commit 87fb5928 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch 'hotline#87090_lunel_pb_de_disponibilite_de_certains_documents' into 'hotline'

hotline #87090 WS Carthame : filter barcodes sent by WS to get only real barcodes

See merge request !3014
parents 561f7e10 d4ee020c
Branches
Tags
3 merge requests!3297WIP: Master,!3047Hotline,!3014hotline #87090 WS Carthame : filter barcodes sent by WS to get only real barcodes
Pipeline #6394 passed with stage
in 33 minutes and 31 seconds
- ticket #87090 : Web services SIGB Carthame : contournement des erreurs du web service qui peut renvoyer plusieurs valeurs différentes pour le code barres exemplaire.
\ No newline at end of file
......@@ -23,6 +23,7 @@ class Class_WebService_SIGB_Carthame_RecordResponseReader {
const STATUT_RESERVE = 3;
const STATUT_PRETE = 4;
const STATUT_EXCLU = 6;
const BARCODE_MIN_LEN = 4;
/** @var Class_WebService_XMLParser */
protected $_xml_parser;
......@@ -67,6 +68,10 @@ class Class_WebService_SIGB_Carthame_RecordResponseReader {
public function endSFa($data) {
//@see http://forge.afi-sa.fr/issues/87090
if (strlen(trim($data)) < static::BARCODE_MIN_LEN)
return;
$this->_current_exemplaire->setCodeBarre((string)$data);
}
......
......@@ -134,10 +134,18 @@ class CarthameKtmNoticeAlbatorTest extends CarthameTestCase {
$copies = $this->albator->getExemplaires();
$this->assertEquals('Disponible', $copies[0]->getDisponibilite());
}
/** @test */
public function secondCopyBarCodeShouldBe88446464646() {
$copies = $this->albator->getExemplaires();
$this->assertEquals('88446464646', $copies[1]->getCodeBarre());
}
}
abstract class CarthameOperationTestCase extends CarthameTestCase {
public function setUp() {
parent::setUp();
......@@ -988,6 +996,7 @@ class CarthameTestFixtures {
<SFv>Quetigny</SFv>
<SFo>3</SFo>
<SFq>20111111</SFq>
<SFA>T</SFA>
</F941>
</Unimarc>
</Notice>
......
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