object=new Acc_Balance($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_Balance::get_row */ public function testGet_row() { global $g_connection,$g_user; $g_user=new User($g_connection,1); $max=$g_connection->get_value("select max(p_id) from parm_periode"); $min=$g_connection->get_value("select min(p_id) from parm_periode"); $this->object->jrn=NULL; $array=$this->object->get_row($min,$max); $this->assertEquals(35,count($array)); $this->object->jrn=[2,4]; $array=$this->object->get_row($min,$max); $this->assertEquals(16,count($array)); } /** * @covers Acc_Balance::filter_cat */ public function testFilter_cat() { $this->object->jrn=1; $this->object->filter_cat(array()); $this->assertEquals($this->object->jrn,null); $this->object->filter_cat(array('2'=>'FIN')); $this->assertEquals([1,83,152],$this->object->jrn); $this->object->filter_cat(array('1'=>'ACH','2'=>'FIN')); $this->assertEquals([35,3,1,83,152],$this->object->jrn); } /** *@covers Acc_Balance::summary_add *@depend Acc_Balance::summary_init */ public function testSummary_add() { $array=$this->object->summary_init(); $result=$this->object->summary_add($array,'600',100,0); $this->assertEquals(100,$result['6']['deb']); $result=$this->object->summary_add($result,'6500',50,0); $this->assertEquals(150,$result['6']['deb']); $result=$this->object->summary_add($result,'2600',0,100); $this->assertEquals(100,$result['1_5']['cred']); $this->assertEquals(0,$result['1_5']['deb']); $result=$this->object->summary_add($result,'2400',100,0); $this->assertEquals(100,$result['1_5']['deb']); } /** *@covers Acc_Balance::summary_add *@depend Acc_Balance::summary_init */ public function testSummary_display() { $array=$this->object->summary_init(); $output='
| Class 1-5 | 0,00 | = |
| Class 6 | 0,00 | = |
| Class 7 | 0,00 | = |
| Solde 6/7 | 0,00 | = |