object = new Acc_Operation($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_OperationTest::get * @todo Implement testGet(). */ public function testGet() { $this->assertEquals(0,0); } /** *@covers Acc_Operation::seek_group * @todo Implement seek_group() */ public function testSeek_group() { $this->object->jr_id=39; $r=$this->object->seek_group(); $this->assertEquals(2922,$r); } /** * @covers Acc_Operation::set_id * @todo Implement testId() * */ public function testSet_id() { $this->object->set_id(1000); $this->assertEquals(1000,$this->object->jr_id); try { $this->object->set_id('AB'); } catch (Exception $e) { $this->assertEquals($e->getMessage(),'Acc_Operation::set_id , id invalide '); } } /** * @covers Acc_Operation::set_paid * @todo Implement testSet_paid */ function testSet_Paid() { $row=$this->object->db->get_array('select * from jrn where jr_rapt <> $1 limit 1',array('paid')); if ( ! $row ) { echo "Aucune ligne trouvée"; } else { $this->object->jr_id=$row[0]['jr_id']; $this->object->set_paid(); $status=$this->object->db->get_value ('select jr_rapt from jrn where jr_id=$1',array($row[0]['jr_id'])); $this->assertEquals($status,'paid'); } } /** * @covers Acc_Operation::get_amount * @todo Implement testGet_amount */ function testGet_Amount() { $row=$this->object->db->get_array('select * from jrn limit 1'); if ( ! $row ) { echo "Aucune ligne trouvée"; $this->assertTrue(FALSE); } else { $this->object->jr_id=$row[0]['jr_id']; $amount=$this->object->get_amount(); $this->assertEquals($amount,$row[0]['jr_montant']); } } }