[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 02/02: Task #1044 - Implementation de PHPUNIT
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 02/02: Task #1044 - Implementation de PHPUNIT Class Acc_Parm_Code |
Date: |
Fri, 07 Nov 2014 22:53:38 +0000 |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 31395e58176f45eb703bff8abf096b5e3990fa1a
Author: Dany De Bontridder <address@hidden>
Date: Fri Nov 7 23:52:08 2014 +0100
Task #1044 - Implementation de PHPUNIT
Class Acc_Parm_Code
---
unit-test/include/class_acc_parm_codeTest.php | 108 +++++++++++++++++++++++++
1 files changed, 108 insertions(+), 0 deletions(-)
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 0000000..b4f0f42
--- /dev/null
+++ b/unit-test/include/class_acc_parm_codeTest.php
@@ -0,0 +1,108 @@
+<?php
+
+/**
+ * Generated by PHPUnit_SkeletonGenerator on 2014-11-07 at 23:05:35.
+ */
+class Acc_Parm_CodeTest extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * @var Acc_Parm_Code
+ */
+ protected $object;
+
+ /**
+ * Sets up the fixture, for example, opens a network connection.
+ * This method is called before a test is executed.
+ */
+ protected function setUp()
+ {
+ global $g_connection;
+ $_REQUEST['gDossier'] = DOSSIER;
+ $g_connection=new Database(DOSSIER);
+ $this->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;$i<count($a_result);$i++)
+ {
+ $code=$a_result[$i]->p_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);
+ }
+
+}