diff --git a/unit-test/include/class_acc_parm_codeTest.php b/unit-test/include/class_acc_parm_codeTest.php new file mode 100644 index 000000000..b4f0f4206 --- /dev/null +++ b/unit-test/include/class_acc_parm_codeTest.php @@ -0,0 +1,108 @@ +object=new Acc_Parm_Code($g_connection); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + + } + + /** + * @covers Acc_Parm_Code::load_all + * @todo Implement testLoad_all(). + */ + public function testLoad_all() + { + + $a_result=$this->object->load_all(); + for ($i=0;$ip_code; + if (! in_array($code, array('BANQUE','CAISSE','COMPTE_COURANT','COMPTE_TVA', + 'CUSTOMER','DEP_PRIV','DNA','SUPPLIER','TVA_DED_IMPOT','TVA_DNA','VENTE','VIREMENT_INTERNE'))) + $this->assertNull('code inconnu'.$code); + } + + + } + + /** + * @covers Acc_Parm_Code::save + * @todo Implement testSave(). + */ + public function testSave() + { + global $g_connection; + + $this->object->save(); + $a=new Acc_Parm_Code($g_connection,'CAISSE'); + $save=clone ($a); + $a->p_code='CAISSE'; + $a->p_comment='TEST'; + $a->p_value='5'; + $a->save(); + $test=new Acc_Parm_Code($g_connection,'CAISSE'); + $this->assertEquals($test->p_code,$a->p_code); + $this->assertEquals($test->p_comment,$a->p_comment); + $this->assertEquals($test->p_value,$a->p_value); + $save->save(); + } + + /** + * @covers Acc_Parm_Code::display + * @todo Implement testDisplay(). + */ + public function testDisplay() + { + $this->object->display(); + $this->assertTrue(TRUE); + } + + /** + * @covers Acc_Parm_Code::form + * @todo Implement testForm(). + */ + public function testForm() + { + $this->object->form(); + $this->assertTrue(TRUE); + } + + /** + * @covers Acc_Parm_Code::load + * @todo Implement testLoad(). + */ + public function testLoad() + { + $this->object->load(); + $this->object->p_code='CAISSE'; + $this->object->load(); + $this->assertTrue(TRUE); + } + +}