From 056f7129ef4ae3e318eae28b2e200173da403c7e Mon Sep 17 00:00:00 2001 From: Patrick Barroca <pbarroca@sandbox.pergame.net> Date: Tue, 23 Feb 2016 10:56:51 +0100 Subject: [PATCH] rel #37078 : fix file path of a generated planned integration --- VERSIONS_HOTLINE/37078 | 1 + .../controllers/IntegrationControllerTest.php | 42 +++++++++---------- library/Class/Cosmogramme/Generator.php | 3 +- 3 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 VERSIONS_HOTLINE/37078 diff --git a/VERSIONS_HOTLINE/37078 b/VERSIONS_HOTLINE/37078 new file mode 100644 index 00000000000..5ec8496420e --- /dev/null +++ b/VERSIONS_HOTLINE/37078 @@ -0,0 +1 @@ + - ticket #37078 : Cosmogramme : Correction du chemin de fichier lors de la génération de site Nanook \ No newline at end of file diff --git a/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/IntegrationControllerTest.php b/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/IntegrationControllerTest.php index ddf0d1d9dca..803ddf1e175 100644 --- a/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/IntegrationControllerTest.php +++ b/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/IntegrationControllerTest.php @@ -170,7 +170,7 @@ abstract class Cosmo_IntegrationControllerGenerateActionTestCase extends CosmoCo $subdir_calls = 0; $subdir_provider = function() use (&$subdir_calls) { $subdir_calls++; - $mapping = [1 => '.', 2 => '..', 3 => 'library1', 4 => 'test']; + $mapping = [1 => '.', 2 => '..', 3 => 'library', 4 => 'test']; return array_key_exists($subdir_calls, $mapping) ? $mapping[$subdir_calls] : false; }; @@ -184,43 +184,43 @@ abstract class Cosmo_IntegrationControllerGenerateActionTestCase extends CosmoCo ->whenCalled('readdir')->with(true) ->willDo($subdir_provider) - ->whenCalled('is_dir')->with('../ftp/transfert/library1') + ->whenCalled('is_dir')->with('../ftp/transfert/library') ->answers(true) ->whenCalled('is_readable') - ->with('../ftp/transfert/library1/etalon') + ->with('../ftp/transfert/library/etalon') ->answers(true) ->whenCalled('is_readable') - ->with('../ftp/transfert/library1/etalon/annexes.txt') + ->with('../ftp/transfert/library/etalon/annexes.txt') ->answers(true) ->whenCalled('is_readable') - ->with('../ftp/transfert/library1/etalon/genres.txt') + ->with('../ftp/transfert/library/etalon/genres.txt') ->answers(true) ->whenCalled('is_readable') - ->with('../ftp/transfert/library1/etalon/sections.txt') + ->with('../ftp/transfert/library/etalon/sections.txt') ->answers(true) ->whenCalled('is_readable') - ->with('../ftp/transfert/library1/etalon/emplacements.txt') + ->with('../ftp/transfert/library/etalon/emplacements.txt') ->answers(true) ->whenCalled('file') - ->with('../ftp/transfert/library1/etalon/annexes.txt') + ->with('../ftp/transfert/library/etalon/annexes.txt') ->answers(['BIB_SPS_UTT|ID_SITE|LIBELLE', '20|library1', '12|library2']) ->whenCalled('file') - ->with('../ftp/transfert/library1/etalon/sections.txt') + ->with('../ftp/transfert/library/etalon/sections.txt') ->answers(['BIB_C_SECTION|CODE|LIBELLE', '1|Adulte', '2|Jeunesse']) ->whenCalled('file') - ->with('../ftp/transfert/library1/etalon/emplacements.txt') + ->with('../ftp/transfert/library/etalon/emplacements.txt') ->answers(['BIB_C_EMPLACEMENT|CODE|LIBELLE', '4|Coin des tout-petits', '5|Livres CD', @@ -228,7 +228,7 @@ abstract class Cosmo_IntegrationControllerGenerateActionTestCase extends CosmoCo '7|Albums']) ->whenCalled('file') - ->with('../ftp/transfert/library1/etalon/genres.txt') + ->with('../ftp/transfert/library/etalon/genres.txt') ->answers(['BIB_GENRES|SUPPORT|CODE|LIBELLE|DOC', '0|1|Album|f', '0|2|Bande dessinée|f', @@ -326,7 +326,7 @@ class Cosmo_IntegrationControllerGenerateActionNanookPostTest Class_Cosmogramme_Generator_AbstractTask::setTimeSource($time_source); $this->postDispatch('cosmo/integration/generate', - ['path_ftp' => 'library1', + ['path_ftp' => 'library', 'type_sigb' => 13, 'service_nanook' => 'http://nanook-ws.net/ilsdi/', 'creer_annexes' => 1, @@ -369,7 +369,7 @@ class Cosmo_IntegrationControllerGenerateActionNanookPostTest public function library1ShouldBeCreated() { $this->assertNotNull(Class_Bib::findFirstBy(['id_site' => 20, 'libelle' => 'library1', - 'ville' => 'library1', + 'ville' => 'library', 'id_zone' => 1, 'visibilite' => Class_Bib::V_DATA]), $this->_response->getBody()); @@ -426,7 +426,7 @@ class Cosmo_IntegrationControllerGenerateActionNanookPostTest 'rang' => 2001, 'profil' => $profile->getId(), 'type_operation' => Class_IntMajAuto::OP_ITEMS_DELETION, - 'nom_fichier' => 'library1/site20/suppressions.txt'])); + 'nom_fichier' => 'library/site20/suppressions.txt'])); } @@ -435,7 +435,7 @@ class Cosmo_IntegrationControllerGenerateActionNanookPostTest $this->assertNotNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20, 'profil' => 104, 'type_operation' => Class_IntMajAuto::OP_FULL_IMPORT, - 'nom_fichier' => 'library1/site20/notices_total.txt'])); + 'nom_fichier' => 'library/site20/notices_total.txt'])); } @@ -444,7 +444,7 @@ class Cosmo_IntegrationControllerGenerateActionNanookPostTest $this->assertNotNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20, 'profil' => 104, 'type_operation' => Class_IntMajAuto::OP_PARTIAL_IMPORT, - 'nom_fichier' => 'library1/site20/notices.txt'])); + 'nom_fichier' => 'library/site20/notices.txt'])); } @@ -453,7 +453,7 @@ class Cosmo_IntegrationControllerGenerateActionNanookPostTest $this->assertNotNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20, 'profil' => 105, 'type_operation' => Class_IntMajAuto::OP_FULL_IMPORT, - 'nom_fichier' => 'library1/site20/abonnes.txt'])); + 'nom_fichier' => 'library/site20/abonnes.txt'])); } @@ -462,7 +462,7 @@ class Cosmo_IntegrationControllerGenerateActionNanookPostTest $this->assertNotNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20, 'profil' => 102, 'type_operation' => Class_IntMajAuto::OP_FULL_IMPORT, - 'nom_fichier' => 'library1/site20/prets.txt'])); + 'nom_fichier' => 'library/site20/prets.txt'])); } @@ -471,7 +471,7 @@ class Cosmo_IntegrationControllerGenerateActionNanookPostTest $this->assertNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20, 'profil' => 103, 'type_operation' => Class_IntMajAuto::OP_FULL_IMPORT, - 'nom_fichier' => 'library1/site20/reservations.txt'])); + 'nom_fichier' => 'library/site20/reservations.txt'])); } @@ -494,7 +494,7 @@ class Cosmo_IntegrationControllerGenerateActionNanookPostTest $this->assertNotNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20, 'profil' => $profile->getId(), 'type_operation' => Class_IntMajAuto::OP_FULL_IMPORT, - 'nom_fichier' => 'library1/site20/paniers_total.txt'])); + 'nom_fichier' => 'library/site20/paniers_total.txt'])); } @@ -506,7 +506,7 @@ class Cosmo_IntegrationControllerGenerateActionNanookPostTest $this->assertNotNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20, 'profil' => $profile->getId(), 'type_operation' => Class_IntMajAuto::OP_PARTIAL_IMPORT, - 'nom_fichier' => 'library1/site20/paniers.txt'])); + 'nom_fichier' => 'library/site20/paniers.txt'])); } diff --git a/library/Class/Cosmogramme/Generator.php b/library/Class/Cosmogramme/Generator.php index 65444446c19..ef6cd6ee358 100644 --- a/library/Class/Cosmogramme/Generator.php +++ b/library/Class/Cosmogramme/Generator.php @@ -181,8 +181,7 @@ class Class_Cosmogramme_Generator { $id_bib = $elem[0]; Class_IntMajAuto::deleteBy(['id_bib' => $id_bib]); - $lib_label = trim($elem[1]); - return $this->getPlannedGenerator()->plan($id_bib, $lib_label); + return $this->getPlannedGenerator()->plan($id_bib, $this->_params['path_ftp']); } -- GitLab