From 0b7301a61704ae4bdb6361b20002e5d96d5fd37c Mon Sep 17 00:00:00 2001
From: pbarroca <pbarroca@afi-sa.fr>
Date: Thu, 24 Sep 2015 17:04:32 +0200
Subject: [PATCH] rel #24999 : fix test failure

---
 .../tests/php/classes/NoticeUnimarcTest.php   | 23 ++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/cosmogramme/tests/php/classes/NoticeUnimarcTest.php b/cosmogramme/tests/php/classes/NoticeUnimarcTest.php
index 3855b871c4c..caeb75168af 100644
--- a/cosmogramme/tests/php/classes/NoticeUnimarcTest.php
+++ b/cosmogramme/tests/php/classes/NoticeUnimarcTest.php
@@ -38,6 +38,18 @@ class NoticeUnimarcThesaurusFieldTest extends ModelTestCase {
 
 /** @see http://forge.afi-sa.fr/issues/24999 */
 class NoticeUnimarcMultipleIsbnTest extends ModelTestCase {
+  public function setUp() {
+    parent::setUp();
+    Storm_Model_Loader::defaultToVolatile();
+  }
+
+
+  public function tearDown() {
+    Storm_Model_Loader::defaultToDb();
+    parent::tearDown();
+  }
+
+
   /** @test */
   public function withTwoIsbnsShouldKeepIsbn13() {
     $type_doc = [['code' => '0',  'label' => '',       'zone_995' => '' ],
@@ -84,15 +96,20 @@ class NoticeUnimarcMultipleIsbnTest extends ModelTestCase {
                     ]
                    ]);
 
-    $this->fixture('Class_CodifTypeDoc',
+    $codif_type_doc = $this->fixture('Class_CodifTypeDoc',
+                                     ['id' => 31,
+                                      'label' => 'Romans gros caractères',
+                                      'famille_id' => Class_CodifTypeDoc::LIVRE]);
+
+    $this->fixture('Class_TypeDoc',
                    ['id' => 31,
                     'label' => 'Romans gros caractères',
-                    'famille_id' => Class_CodifTypeDoc::LIVRE]);
+                    'codif_type_doc' => $codif_type_doc]);
 
     $record = new notice_unimarc();
     $record->ouvrirNotice(file_get_contents(__DIR__ . '/unimarc_multi_isbn.txt'), 408);
     $record = $record->getNoticeIntegration();
 
-    $this->assertEquals('978-2-8401-1742-1', $record['isbn']);
+    $this->assertEquals('978-2-8401-1742-1', $record['isbn'], json_encode($record));
   }
 }
\ No newline at end of file
-- 
GitLab