diff --git a/VERSIONS_HOTLINE/82087 b/VERSIONS_HOTLINE/82087 new file mode 100644 index 0000000000000000000000000000000000000000..158a90695147260c89c8310b3639135c0d9d2bd2 --- /dev/null +++ b/VERSIONS_HOTLINE/82087 @@ -0,0 +1 @@ + - ticket #82087 : Cosmogramme : Meilleure prise en charge de l'encodage de cararcères de l'étalon Nanook \ No newline at end of file diff --git a/library/Class/Cosmogramme/Generator/KindsTask.php b/library/Class/Cosmogramme/Generator/KindsTask.php index 416ddd21d3dfaedf8b5bea4cccf3c5f09f161226..7e7790a9c19e9c48a909e0fdff1b1b9d25b4437a 100644 --- a/library/Class/Cosmogramme/Generator/KindsTask.php +++ b/library/Class/Cosmogramme/Generator/KindsTask.php @@ -37,8 +37,7 @@ class Class_Cosmogramme_Generator_KindsTask extends Class_Cosmogramme_Generator_ protected function _prepareOne($data) { - $data = utf8_encode($data); - $elems = explode('|', $data); + $elems = $this->_extract($data); if ('BIB_' == substr($elems[0], 0, 4) || !trim($elems[1])) return ''; diff --git a/tests/library/Class/Cosmogramme/Integration/PhasePrepareIntegrationsTest.php b/tests/library/Class/Cosmogramme/Integration/PhasePrepareIntegrationsTest.php index c6192da2af56313d99ec40694e3b79711b183eeb..bd09b098b8321b2a2431c715914675f8bfb16612 100644 --- a/tests/library/Class/Cosmogramme/Integration/PhasePrepareIntegrationsTest.php +++ b/tests/library/Class/Cosmogramme/Integration/PhasePrepareIntegrationsTest.php @@ -394,7 +394,8 @@ class PhasePrepareIntegrationsNanookStandardTest ->whenCalled('getKindsOf')->with('foo') ->answers(['BIB_GENRES|SUPPORT|CODE|LIBELLE|DOC', - '0|1|Music|f']) + '0|1|Music|f', + '0|2|Bande dessinée|f']) ->beStrict(); @@ -462,7 +463,7 @@ class PhasePrepareIntegrationsNanookStandardTest ->with('delete from ' . $table . ' where date_maj != "' . $now->dateYmd() . '"') ->willDo(function() use ($model_class, $now) { - $model_class::deleteBy(['date_maj not' => $now->dateDayAndHours()]); + $model_class::deleteBy(['date_maj not' => $now->dateYmd()]); }) ->whenCalled('query') @@ -670,6 +671,26 @@ class PhasePrepareIntegrationsNanookStandardTest } + /** @test */ + public function kindsCountShouldBe2() { + $this->assertEquals(2, Class_CodifGenre::count()); + } + + + /** @test */ + public function firstKindLabelShouldBeMusic() { + $this->assertNotNull($kind = Class_CodifGenre::findFirstBy(['regles' => '995$7=1'])); + $this->assertEquals('Music', $kind->getLibelle()); + } + + + /** @test */ + public function secondKindLabelShouldBeBandeDessinée() { + $this->assertNotNull($kind = Class_CodifGenre::findFirstBy(['regles' => '995$7=2'])); + $this->assertEquals('Bande dessinée', $kind->getLibelle()); + } + + /** @test */ public function plannedIntegrationsOfRemovedLibraryShouldBeDeleted() { $this->assertEmpty(Class_IntMajAuto::findAllBy(['id_bib' => 3]));