Skip to content
Snippets Groups Projects
Commit 9c3737c4 authored by Laurent's avatar Laurent
Browse files

hotline #34250 patrons integration: fix negative failures

parent 786bdb1a
Branches
Tags
7 merge requests!1553Master,!1502Master,!1501Stable,!1472Stable,!1375Master,!1372Hotline master,!1369Hotline#34250 suite problemes infra ftp les imports totaux abonnes ne doivent plus supprimer d abonnes
......@@ -69,14 +69,12 @@ class abonne
public function importFicheAscii($data) {
$data=$this->changeAccents($data);
$enreg['MAIL'] = '';
// Données d'import
$data=explode(chr(9),$data);
for($i=0; $i<count($this->champs); $i++) {
$colonne=$this->champs[$i];
if($colonne!="NULL")
$enreg[$colonne]=$data[$i];
$data = $this->changeAccents($data);
$data = explode(chr(9),$data);
for($i = 0; $i < count($this->champs); $i++) {
$colonne = $this->champs[$i];
$enreg[$colonne] = $data[$i];
}
$this->importFicheArray(array_filter($enreg));
......@@ -92,13 +90,17 @@ class abonne
}
unset($enreg["NUM_CARTE"]);
unset($enreg["NULL"]);
if(isset($enreg["NAISSANCE"]) && (strlen($enreg["NAISSANCE"]) == 10))
$enreg["NAISSANCE"]=rendDate($enreg["NAISSANCE"], 0);
$enreg["NAISSANCE"] = rendDate($enreg["NAISSANCE"], 0);
if(!$enreg["PASSWORD"] and $enreg["NAISSANCE"])
$enreg["PASSWORD"]=rendDate($enreg["NAISSANCE"],1);
$enreg['MAIL']=$this->clean_email($enreg['MAIL']);
$enreg["PASSWORD"] = rendDate($enreg["NAISSANCE"],1);
if (isset($enreg['MAIL']))
$enreg['MAIL'] = $this->clean_email($enreg['MAIL']);
$this->saveorUpdateInDB($enreg);
}
......
......@@ -44,7 +44,7 @@ abstract class PhasePatronsTestCase extends Class_Cosmogramme_Integration_PhaseT
'accents' => Class_IntProfilDonnees::ENCODING_UTF8,
'type_fichier' => Class_IntProfilDonnees::FT_PATRONS,
'format' => Class_IntProfilDonnees::FORMAT_PIPED_ASCII,
'attributs' => [1 => ['champs' => 'IDABON;ID_SIGB;ORDREABON;NOM;PRENOM;PASSWORD;MAIL;NAISSANCE; DATE_FIN ']]]);
'attributs' => [1 => ['champs' => 'IDABON;ID_SIGB;ORDREABON;NOM;PRENOM;PASSWORD;MAIL;NAISSANCE ;NULL ; DATE_FIN ']]]);
$this->fixture('Class_Cosmogramme_Integration',
['id' => 999,
......@@ -165,6 +165,15 @@ class PhasePatronsFullImportTest extends PhasePatronsTestCase {
}
/**
* @depends secondAbonneShouldBeBarryWhite
* @test
*/
public function barryShouldNotHaveNULLAttribute($barry) {
$this->assertNotContains('null', array_keys($barry->getRawAttributes()));
}
/**
* @depends secondAbonneShouldBeBarryWhite
* @test
......
BIB_ABON_CARTE|ID_ABON|ORDRE|NOM|PRENOM|MOT_DE_PASSE|E_MAIL|NAISSANCE|DATE_FIN
A-000208|54923|2|MIESZKALSKI|brown|2001||2007-07-20|2011-08-28
A-000033|47|1|BARRY|white|1978||1978-05-19|2006-03-23
A-000893|72|1|CHHIENG|pink|1965|p.chhieng@mailoo.com|1964-03-05|2015-07-04
A-000123|89|1|MOUSTAKI|Georges|1936|papayoyo@dead.fr|1935-02-22|2016-06-16
BIB_ABON_CARTE|ID_ABON|ORDRE|NOM|PRENOM|MOT_DE_PASSE|E_MAIL|NAISSANCE|TRUC|DATE_FIN
A-000208|54923|2|MIESZKALSKI|brown|2001||2007-07-20|zork|2011-08-28
A-000033|47|1|BARRY|white|1978||1978-05-19||2006-03-23
A-000893|72|1|CHHIENG|pink|1965|p.chhieng@mailoo.com|1964-03-05|bidule|2015-07-04
A-000123|89|1|MOUSTAKI|Georges|1936|papayoyo@dead.fr|1935-02-22| |2016-06-16
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