Skip to content
Snippets Groups Projects
Commit 8ac3cdb9 authored by gloas's avatar gloas
Browse files

ajout des tests + refacto class abonne cosmogramme avant rel #9357

parent a50318db
Branches
Tags
No related merge requests found
......@@ -79,7 +79,7 @@ class AbonneIntegrationASCIIWithNoUsersInDbTest extends AbonneIntegrationASCIITe
public function setup(){
parent::setup();
$champs_sigb = ['1234','12','2','Tom','paul','ici','tp@afi-sa.fr'];
$champs_sigb = ['12 3 4','12','2','Tom','paul','ici','tp@afi-sa.fr'];
$champs_sigb_ascii = implode(chr(9), $champs_sigb);
$this->abon_config->importFicheAscii($champs_sigb_ascii);
$this->user_tom = Class_Users::getFirstAttributeForLastCallOn('save');
......@@ -88,7 +88,7 @@ class AbonneIntegrationASCIIWithNoUsersInDbTest extends AbonneIntegrationASCIITe
/** @test **/
public function abonneSigbTomIdShouldBe1234() {
$this->assertEquals('1234', $this->user_tom->getIdabon());
$this->assertEquals('12 3 4', $this->user_tom->getIdabon());
}
}
......@@ -109,11 +109,11 @@ class AbonneIntegrationASCIIWithRoutoInDbTest extends AbonneIntegrationASCIITest
'password'=>'old']);
Class_Users::whenCalled('findFirstBy')
->with(['login'=>'55',
->with(['login'=>'5 5',
'id_site'=>2])
->answers($this->user_routo);
$champs_sigb_ascii = implode(chr(9), ['55',
$champs_sigb_ascii = implode(chr(9), ['5 5',
'12',
'2',
'Routo',
......@@ -128,7 +128,7 @@ class AbonneIntegrationASCIIWithRoutoInDbTest extends AbonneIntegrationASCIITest
/** @test **/
public function withRoutoInDbImportShouldUpdateRoutoWithIdabon55() {
$this->assertEquals('55',$this->routo_after_import->getIdabon());
$this->assertEquals('5 5',$this->routo_after_import->getIdabon());
}
......@@ -177,11 +177,11 @@ class AbonneIntegrationXMLWithRoutoInDbTest extends AbonneIntegrationXMLTestCase
'password'=>'allez les bleus']);
Class_Users::whenCalled('findFirstBy')
->with(['login'=>'01003080',
->with(['login'=>'0100 3080',
'id_site'=>2])
->answers($this->user_zozio);
$champs_sigb_xml = '<Item><TYPE_ABONNE>I</TYPE_ABONNE><LECTNUM>01003080</LECTNUM><LASTNAME>poirreau</LASTNAME><FIRSTNAME>Zozio</FIRSTNAME><FULLNAME>Piou Piou</FULLNAME><DATEBIRTH>12/31/2012</DATEBIRTH><MOT_DE_PASSE>allez les bleus</MOT_DE_PASSE></Item>';
$champs_sigb_xml = '<Item><TYPE_ABONNE>I</TYPE_ABONNE><LECTNUM>0100 3080</LECTNUM><LASTNAME>poirreau</LASTNAME><FIRSTNAME>Zozio</FIRSTNAME><FULLNAME>Piou Piou</FULLNAME><DATEBIRTH>12/31/2012</DATEBIRTH><MOT_DE_PASSE>allez les bleus</MOT_DE_PASSE></Item>';
$this->abon_config->importFicheXml($champs_sigb_xml);
......@@ -190,7 +190,7 @@ class AbonneIntegrationXMLWithRoutoInDbTest extends AbonneIntegrationXMLTestCase
/** @test **/
public function withRoutoInDbImportShouldUpdateRoutoWithIdabon55() {
$this->assertEquals('01003080',$this->zozio_after_import->getIdabon());
$this->assertEquals('0100 3080',$this->zozio_after_import->getIdabon());
}
......
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