Commit d4cd34b6 authored by Patrick Barroca's avatar Patrick Barroca 🎮

dev #71412 : fix double finder in items deletion file import context

parent 666add76
- ticket #71412 : Intégrations cosmogramme : correction de la prise en compte des fichiers de suppressions d'exemplaires
......@@ -53,7 +53,7 @@ class Class_Notice_DoubleFinder {
return true;
}
if($this->_profil && ($this->_profil->isFormatDublinCore() || $this->_profil->isBibliondemand()))
if ($this->_profil && ($this->_profil->isFormatDublinCore() || $this->_profil->isBibliondemand()))
return false;
if ($this->_id = $this->findByIdOrigine()) {
......@@ -114,6 +114,9 @@ class Class_Notice_DoubleFinder {
foreach($founds as $found)
if($this->_data->gettype_doc() == $found->getTypeDoc())
return $found->getIdNotice();
if (0 == $this->_data->gettype_doc())
return $founds[0]->getIdNotice();
}
......
......@@ -39,6 +39,19 @@ abstract class DoubleFinderTestCase extends ModelTestCase {
protected function _prepareFixtures() {
$item = $this->fixture('Class_Exemplaire',
['id' => 1,
'code_barres' => '159',
'id_origine' => '88903',
'id_int_bib' => 1]);
$this->fixture('Class_Notice',
['id' => 1,
'type_doc' => Class_TypeDoc::LIVRE,
'isbn' => '2-85868-161-9',
'clef_alpha' => 'JESUISNEBONHOMME--SARA--EDTHIERRYMAGNIER-2010-1',
'exemplaires' => [$item]]);
$dilicom_item = $this->fixture('Class_Exemplaire',
['id' => 2,
'code_barres' => '0001-2',
......@@ -53,10 +66,10 @@ abstract class DoubleFinderTestCase extends ModelTestCase {
'exemplaires' => [$dilicom_item]]);
$rss_item = $this->fixture('Class_Exemplaire',
['id' => 3,
'code_barres' => '159',
'id_origine' => '789',
'id_int_bib' => 1]);
['id' => 3,
'code_barres' => '159',
'id_origine' => '789',
'id_int_bib' => 1]);
$this->fixture('Class_Notice',
['id' => 3,
......@@ -65,18 +78,6 @@ abstract class DoubleFinderTestCase extends ModelTestCase {
'clef_alpha' => 'JESUISNEBONHOMME--SARA--EDTHIERRYMAGNIER-2010-1',
'exemplaires' => [$rss_item]]);
$item = $this->fixture('Class_Exemplaire',
['id' => 1,
'code_barres' => '159',
'id_origine' => '88903',
'id_int_bib' => 1]);
$this->fixture('Class_Notice',
['id' => 1,
'type_doc' => Class_TypeDoc::LIVRE,
'isbn' => '2-85868-161-9',
'clef_alpha' => 'JESUISNEBONHOMME--SARA--EDTHIERRYMAGNIER-2010-1',
'exemplaires' => [$item]]);
}
......@@ -130,6 +131,19 @@ class DoubleFinderWithExistingItemTest extends DoubleFinderWithRecordMatchingTes
class DoubleFinderWithExistingItemForDeletionTest extends DoubleFinderWithRecordMatchingTestCase {
protected $_data = ['type_doc' => Class_TypeDoc::UNKNOWN,
'statut_exemplaires' => ['nb_ex' => 1],
'exemplaires' => [ ['code_barres' => '159'] ]];
/** @test */
public function shouldHaveMatchedBarcode() {
$this->assertEquals('code_barres', $this->_finder->getMatchedCriteria());
}
}
class DoubleFinderWithExistingIsbnTest extends DoubleFinderWithRecordMatchingTestCase {
protected $_data = ['type_doc' => Class_TypeDoc::LIVRE,
'isbn13' => '2-85868-161-9'];
......@@ -254,4 +268,4 @@ class DoubleFinderWithExistingIdOrigneNoDedupModeForNanookTestTest extends Doubl
public function shouldHaveMatchedIdOrigine() {
$this->assertEquals('id_origine', $this->_finder->getMatchedCriteria());
}
}
}
\ No newline at end of file
Markdown is supported
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