diff --git a/cosmogramme/tests/php/classes/NoticeUnimarcTest.php b/cosmogramme/tests/php/classes/NoticeUnimarcTest.php index 7604a9404cf4ff98f978c1ad4ffadea6ea28722e..6b5702bd4771f75f2f0deb01f720cb1c74d17cb1 100644 --- a/cosmogramme/tests/php/classes/NoticeUnimarcTest.php +++ b/cosmogramme/tests/php/classes/NoticeUnimarcTest.php @@ -38,8 +38,17 @@ class NoticeUnimarcThesaurusFieldTest extends ModelTestCase { /** @see http://forge.afi-sa.fr/issues/24999 */ class NoticeUnimarcMultipleIsbnTest extends ModelTestCase { - /** @test */ - public function withTwoIsbnsShouldKeepIsbn13() { + protected $_record; + + + public function setUp() { + parent::setUp(); + Storm_Model_Loader::defaultToVolatile(); + + $this->fixture('Class_CosmoVar', + ['id' => 'types_docs', + 'liste' => "0:non identifié\r\n1:livres\r\n2:périodiques\r\n3:disques\r\n4:DVD\r\n5:cédéroms\r\n8:articles cms\r\n9:fils rss\r\n10:sites internet\r\n100:Livre Numérique\r\n101:Diaporamas\r\n102:Type doc\r\n103:OAI\r\n104:Type doc\r\n105:Formation Vodéclic\r\n106:Livres Numériques\r\n107:Vidéos à la demande\r\n108:Tout apprendre\r\n109:Enregistrement audio\r\n110:Numérique Premium"]); + $type_doc = [['code' => '0', 'label' => '', 'zone_995' => '' ], ['code' => '1', 'label' => 'am;na', 'zone_995' => 'LIVR' ], ['code' => '2', 'label' => 'as', 'zone_995' => 'PERI'], @@ -81,8 +90,7 @@ class NoticeUnimarcMultipleIsbnTest extends ModelTestCase { 'format' => Class_IntProfilDonnees::NOVELTY_DATE_FORMAT_VALUES, 'jours' => '15', 'valeurs' => '1'] - ] - ]); + ]]); $codif_type_doc = $this->fixture('Class_CodifTypeDoc', ['id' => 31, @@ -96,8 +104,18 @@ class NoticeUnimarcMultipleIsbnTest extends ModelTestCase { $record = new notice_unimarc(); $record->ouvrirNotice(file_get_contents(__DIR__ . '/unimarc_multi_isbn.txt'), 408); - $record = $record->getNoticeIntegration(); + $this->_record = $record->getNoticeIntegration(); + } - $this->assertEquals('978-2-8401-1742-1', $record['isbn'], json_encode($record)); + + public function tearDown() { + Storm_Model_Loader::defaultToDb(); + parent::tearDown(); + } + + + /** @test */ + public function withTwoIsbnsShouldKeepIsbn13() { + $this->assertEquals('978-2-8401-1742-1', $this->_record['isbn']); } } \ No newline at end of file