diff --git a/VERSIONS_HOTLINE/108436 b/VERSIONS_HOTLINE/108436 new file mode 100644 index 0000000000000000000000000000000000000000..d512da2a23b2e8a14279d47f64c2c1aec2f46d3a --- /dev/null +++ b/VERSIONS_HOTLINE/108436 @@ -0,0 +1 @@ + - ticket #108436 : SIGB Nanook : Correction du dédoublonnage à l'import des abonnés lorsque des intégrations sont programmées pour d'autres sources de données \ No newline at end of file diff --git a/library/Class/IntBib.php b/library/Class/IntBib.php index e9058692fa3b520d568fc0f80e0d535c147d015d..e648df3abd192962b32f994b5512062e94327408 100644 --- a/library/Class/IntBib.php +++ b/library/Class/IntBib.php @@ -471,9 +471,11 @@ class Class_IntBib extends Storm_Model_Abstract { if(empty($profiles)) return false; - return 0 < (new Storm_Collection($profiles)) - ->collect(function($model) {return $model->isPatrons();}) - ->count(); + return null !== (new Storm_Collection($profiles)) + ->detect(function($model) + { + return $model->isPatrons(); + }); } diff --git a/tests/library/Class/IntBibTest.php b/tests/library/Class/IntBibTest.php index 47358fd439e636b941dc99dea91202c701dd1289..e84dc2b66e312b5cc4855920e06f160b5f9efcaf 100644 --- a/tests/library/Class/IntBibTest.php +++ b/tests/library/Class/IntBibTest.php @@ -52,43 +52,49 @@ class IntBibTest extends ModelTestCase { class IntBibSingleNanookTest extends ModelTestCase { - protected - $_storm_default_to_volatile = true, - $_id_int_bib; - public function setUp() { parent::setUp(); - $nanook_import = $this->fixture('Class_IntBib', - ['id' => 78, - 'sigb' => Class_IntBib::SIGB_NANOOK, - 'comm_sigb' => Class_IntBib::COM_NANOOK, - 'comm_params' => 'a:1:{s:11:"url_serveur";s:53:"http://nanookws.afi-sa.net/afi_NanookWs/ilsdi/meylan/";}']); - - $prog = $this->fixture('Class_IntMajAuto', ['id' => 100, - 'id_bib' => 78, - 'profil' => 57]); - - $sompe_patrons = $this->fixture('Class_IntProfilDonnees', - ['id' => 57, - 'libelle' => 'Some patrons', - 'type_fichier' => Class_IntProfilDonnees::FT_PATRONS]); - - $koha_import = $this->fixture('Class_IntBib', - ['id' => 987, - 'sigb' => Class_IntBib::SIGB_KOHA, - 'comm_sigb' => Class_IntBib::COM_KOHA, - 'comm_params' => 'a:1:{s:11:"url_serveur";s:53:"http://kohaws.org";}']); + + $this->fixture('Class_IntBib', + ['id' => 78, + 'sigb' => Class_IntBib::SIGB_NANOOK, + 'comm_sigb' => Class_IntBib::COM_NANOOK, + 'comm_params' => 'a:1:{s:11:"url_serveur";s:53:"http://nanookws.afi-sa.net/afi_NanookWs/ilsdi/meylan/";}']); + + $this->fixture('Class_IntMajAuto', ['id' => 100, + 'id_bib' => 78, + 'profil' => 57]); + + $this->fixture('Class_IntProfilDonnees', + ['id' => 57, + 'libelle' => 'Some patrons', + 'type_fichier' => Class_IntProfilDonnees::FT_PATRONS]); + + $this->fixture('Class_IntBib', + ['id' => 987, + 'sigb' => Class_IntBib::SIGB_KOHA, + 'comm_sigb' => Class_IntBib::COM_KOHA, + 'comm_params' => 'a:1:{s:11:"url_serveur";s:53:"http://kohaws.org";}']); + + $this->fixture('Class_IntMajAuto', ['id' => 101, + 'id_bib' => 987, + 'profil' => 58]); + + $this->fixture('Class_IntProfilDonnees', + ['id' => 58, + 'libelle' => 'Some datas', + 'type_fichier' => Class_IntProfilDonnees::FT_RECORDS]); } /** @test */ - public function shouldBeSingleNanook() { - $this->assertTrue(Class_IntBib::isSingleNanookPatrons()); + public function shouldNotBeSingleNanook() { + $this->assertFalse(Class_IntBib::isSingleNanook()); } /** @test */ - public function shouldNotBeSingleNnanook() { + public function shouldBeSingleNanookPatrons() { $this->assertTrue(Class_IntBib::isSingleNanookPatrons()); } } \ No newline at end of file