From 5b4b69373677e2f7e852cc86f9a780f2498e7a92 Mon Sep 17 00:00:00 2001 From: Patrick Barroca <pbarroca@sandbox.pergame.net> Date: Thu, 17 Sep 2015 16:30:58 +0200 Subject: [PATCH] =?UTF-8?q?rel=20#29226=20:=20tests=20sur=20d=C3=A9doublon?= =?UTF-8?q?nage=20Karvi=20sans=20ISBN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSIONS_HOTLINE/29226 | 1 + .../classes/NoticeIntegrationDedupTest.php | 60 ++++++++++++++++++- .../classes/unimarc_mulhouse_remanence.txt | 1 + library/Class/CosmoVar.php | 1 + 4 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 VERSIONS_HOTLINE/29226 create mode 100644 cosmogramme/tests/php/classes/unimarc_mulhouse_remanence.txt diff --git a/VERSIONS_HOTLINE/29226 b/VERSIONS_HOTLINE/29226 new file mode 100644 index 00000000000..b323a71f0ff --- /dev/null +++ b/VERSIONS_HOTLINE/29226 @@ -0,0 +1 @@ + - ticket #29226 : Correction de dédoublonnage Karvi \ No newline at end of file diff --git a/cosmogramme/tests/php/classes/NoticeIntegrationDedupTest.php b/cosmogramme/tests/php/classes/NoticeIntegrationDedupTest.php index e0274469b74..263b45d1ffe 100644 --- a/cosmogramme/tests/php/classes/NoticeIntegrationDedupTest.php +++ b/cosmogramme/tests/php/classes/NoticeIntegrationDedupTest.php @@ -21,12 +21,14 @@ require_once 'NoticeIntegrationTest.php'; -/** @see http://forge.afi-sa.fr/issues/17196 */ + class NoticeIntegrationDedupWithoutIsbnTest extends NoticeIntegrationTestCase { public function getProfilDonnees() { return Class_IntProfilDonnees::forALOES()->setIdProfil(113) ->getRawAttributes(); } + + public function setUp() { parent::setUp(); $this->fixture('Class_Notice', ['id' => 15824768, @@ -74,3 +76,59 @@ class NoticeIntegrationDedupWithoutIsbnTest extends NoticeIntegrationTestCase { $this->assertEquals(2, Class_Notice::count()); } } + + + +/** @see http://forge.afi-sa.fr/issues/29226 */ +class NoticeIntegrationDedupCaliceWithoutIsbnTest extends NoticeIntegrationTestCase { + public function getProfilDonnees() { + return Class_IntProfilDonnees::forKarvi() + ->setIdProfil(113) + ->getRawAttributes(); + } + + + public function setUp() { + parent::setUp(); + + $this->fixture('Class_Notice', + ['id' => 30, + 'type_doc' => 5, + 'alpha_titre' => 'ACTUALITE DU VIRTUEL', + 'alpha_auteur' => 'FR BNF', + 'titres' => 'ACTUALITE AKTUALIT VIRTUEL', + 'auteurs' => 'BNF', + 'editeur' => '[Centre national d\'art et de culture Georges-Pompidou (Paris)]', + 'isbn' => '', + 'ean' => null, + 'id_commerciale' => '', + 'id_bnf' => '', + 'clef_alpha' => 'ACTUALITEDUVIRTUEL--FRB--CENTRENATIONALDARTETDECULTUREGEORGESPOMPIDOUPARIS-1997-5', + 'clef_oeuvre' => 'ACTUALITEDUVIRTUEL--FRB-', + 'clef_chapeau' => '', + 'qualite' => 10, + 'date_creation' => '2015-05-02 00:00:00', + 'date_maj' => '2015-09-13 13:22:53', + 'url_vignette' => 'NO', + 'url_image' => 'NO']); + + VariableCache::getInstance() + ->setValeurCache(['filtrer_fulltext' => 1, + 'mode_doublon'=> 0, + 'tracer_accents_iso' => 0, + 'non_exportable'=> 'electre;decitre;gam;zebris', + 'controle_codes_barres' => 1, + 'unimarc_zone_titre' => '200$a;461$t', + 'unicite_code_barres' => 0, + 'champs_sup' => '', + 'ean_345' => 1]); + + $this->loadNotice('unimarc_mulhouse_remanence'); + } + + + /** @test */ + public function thereShouldHave2Records() { + $this->assertEquals(2, Class_Notice::count()); + } +} diff --git a/cosmogramme/tests/php/classes/unimarc_mulhouse_remanence.txt b/cosmogramme/tests/php/classes/unimarc_mulhouse_remanence.txt new file mode 100644 index 00000000000..bc682c0ced9 --- /dev/null +++ b/cosmogramme/tests/php/classes/unimarc_mulhouse_remanence.txt @@ -0,0 +1 @@ +01265nam 2200277 4500001001200000005001700012010001300029100003500042101000800077102000700085200006000092210002900152215001900181219000900200606005700209606005100266676001100317679000900328700003200337801003000369993001900399995020700418995016900625995016800794999002500962DOC0011089020150907174443.0 d29 Euros a20031209 20 m 0101 aFre aFR aRemanences : Mulhouse au travailbLivrefPierre Dolivet aMulhouse (68)cJDMd2003 a224 p.d30 cm cREM: aClasse ouvrièreyFranceyMulhouse (Haut-Rhin)379180 aIndustrieyFranceyMulhouse (Haut-Rhin)346860 a338.09 aFcM aDolivetbPierre3833864070 aFRbMD68-Colmarc20130827 aremanences.jpg aMD68-ColmarbMD68-ColmarcPFASTATTd68256-1f00100005888712h30588871jakAL 338.09 DOLm20150421n20170421oPqaraztFC79D1FAlsatiquesFAlsatiquesGBH12249819I20040415J29,00L338.09Q7R20150421 aMD68-ColmarbMD68-Colmarf00100005890635h30589063jakAL 338.09 DOLoPqaraztFC79D1FAlsatiquesFAlsatiquesGBH12249820I20040504J29,00L338.09Q17R20150115 aMD68-ColmarbMD68-Colmarf00100005890643h30589064jakAL 338.09 DOLoPqaraztFC79D1FAlsatiquesFAlsatiquesGBH12249821I20040504J29,00L338.09Q3R20111205 zpatchImportOrpheeBdp \ No newline at end of file diff --git a/library/Class/CosmoVar.php b/library/Class/CosmoVar.php index 4f9b0673355..17294b02acb 100644 --- a/library/Class/CosmoVar.php +++ b/library/Class/CosmoVar.php @@ -107,6 +107,7 @@ class Class_CosmoVar extends Storm_Model_Abstract { protected $_loader_class = 'Class_CosmoVarLoader'; const DOUBLE_SEARCH_ALPHA_KEY = 1; + const DOUBLE_SEARCH_IDS = 0; /** * @param string $name -- GitLab