Skip to content
Snippets Groups Projects
Commit 1fde3efc authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

hotline #82087 : fix encoding detection of kinds in standards

parent 7bb2004f
Branches
Tags
3 merge requests!2911Master,!2910Hotline,!2906Hotline#82087 les caracteres accentues des genres de nanook sont mal lus par bokeh
Pipeline #5367 passed with stage
in 31 minutes and 51 seconds
- ticket #82087 : Cosmogramme : Meilleure prise en charge de l'encodage de cararcères de l'étalon Nanook
\ No newline at end of file
......@@ -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 '';
......
......@@ -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]));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment