Fix: Property not loaded

Enhance phpunit
This commit is contained in:
Laurent Destailleur 2011-10-29 18:48:19 +02:00
parent ac183e2483
commit fd9619f4cd
2 changed files with 19 additions and 7 deletions

View File

@ -150,7 +150,6 @@ class Societe extends CommonObject
$this->db = $DB;
$this->id = $id;
$this->client = 0;
$this->prospect = 0;
$this->fournisseur = 0;
@ -720,12 +719,12 @@ class Societe extends CommonObject
$this->parent = $obj->parent;
$this->siren = $obj->siren; // TODO obsolete
$this->idprof1 = $obj->siren;
$this->siret = $obj->siret; // TODO obsolete
$this->idprof2 = $obj->siret;
$this->ape = $obj->ape; // TODO obsolete
$this->idprof3 = $obj->ape;
$this->siren = $obj->idprof1; // TODO obsolete
$this->idprof1 = $obj->idprof1;
$this->siret = $obj->idprof2; // TODO obsolete
$this->idprof2 = $obj->idprof2;
$this->ape = $obj->idprof3; // TODO obsolete
$this->idprof3 = $obj->idprof3;
$this->idprof4 = $obj->idprof4;
$this->capital = $obj->capital;
@ -2521,6 +2520,11 @@ class Societe extends CommonObject
$this->tva_intra='EU1234567';
$this->note_public='This is a comment (public)';
$this->note='This is a comment (private)';
$this->idprof1='idprof1';
$this->idprof2='idprof2';
$this->idprof3='idprof3';
$this->idprof4='idprof4';
}
}

View File

@ -177,6 +177,10 @@ class SocieteTest extends PHPUnit_Framework_TestCase
$localobject->fax='New fax';
$localobject->email='New email';
$localobject->url='New url';
$localobject->idprof1='new idprof1';
$localobject->idprof2='new idprof2';
$localobject->idprof3='new idprof3';
$localobject->idprof4='new idprof4';
$result=$localobject->update($localobject->id,$user);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0);
@ -203,6 +207,10 @@ class SocieteTest extends PHPUnit_Framework_TestCase
$this->assertEquals($localobject->fax, $newobject->fax);
$this->assertEquals($localobject->email, $newobject->email);
$this->assertEquals($localobject->url, $newobject->url);
$this->assertEquals($localobject->idprof1, $newobject->idprof1);
$this->assertEquals($localobject->idprof2, $newobject->idprof2);
$this->assertEquals($localobject->idprof3, $newobject->idprof3);
$this->assertEquals($localobject->idprof4, $newobject->idprof4);
return $localobject;
}