noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 05/28: rename test files:


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 05/28: rename test files:
Date: Sat, 30 Nov 2019 07:51:21 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit b0a2ee222c6947d306abe55271698ab362391592
Author: Dany De Bontridder <address@hidden>
Date:   Wed Nov 13 20:10:10 2019 +0100

    rename test files:
---
 ...rTest.class.php => acc_account_ledger.Test.php} |   0
 ..._balanceTest.class.php => acc_balance.Test.php} |   0
 ...{acc_bilanTest.class.php => acc_bilan.Test.php} |   0
 ..._computeTest.class.php => acc_compute.Test.php} |   0
 ...cc_ledgerTest.class.php => acc_ledger.Test.php} |   0
 ...r_finTest.class.php => acc_ledger_fin.Test.php} |   0
 unit-test/include/class/acc_ledger_historyTest.php | 136 +++++++++++++++++++++
 ...s.php => acc_ledger_history_financial.Test.php} |   0
 ...ass.php => acc_ledger_history_generic.Test.php} |   0
 ...ss.php => acc_ledger_history_purchase.Test.php} |   0
 ....class.php => acc_ledger_history_sale.Test.php} |   0
 ...infoTest.class.php => acc_ledger_info.Test.php} |   0
 ...Test.class.php => acc_ledger_purchase.Test.php} |   0
 ...soldTest.class.php => acc_ledger_sold.Test.php} |   0
 ...rationTest.class.php => acc_operation.Test.php} |   0
 ...m_codeTest.class.php => acc_parm_code.Test.php} |   0
 ...livreTest.class.php => anc_grandlivre.Test.php} |   0
 .../{anc_keyTest.class.php => anc_key.Test.php}    |   0
 ..._key_sqlTest.class.php => anc_key_sql.Test.php} |   0
 ...rationTest.class.php => anc_operation.Test.php} |   0
 .../{dossierTest.class.php => dossier.Test.php}    |   0
 .../class/{ficheTest.class.php => fiche.Test.php}  |   0
 ...class.php => noalyss_parameter_folder.Test.php} |   0
 ..._summaryTest.class.php => tax_summary.Test.php} |   0
 .../class/{userTest.class.php => user.Test.php}    |   6 -
 unit-test/test-file.sh                             |  10 +-
 26 files changed, 143 insertions(+), 9 deletions(-)

diff --git a/unit-test/include/class/acc_account_ledgerTest.class.php 
b/unit-test/include/class/acc_account_ledger.Test.php
similarity index 100%
rename from unit-test/include/class/acc_account_ledgerTest.class.php
rename to unit-test/include/class/acc_account_ledger.Test.php
diff --git a/unit-test/include/class/acc_balanceTest.class.php 
b/unit-test/include/class/acc_balance.Test.php
similarity index 100%
rename from unit-test/include/class/acc_balanceTest.class.php
rename to unit-test/include/class/acc_balance.Test.php
diff --git a/unit-test/include/class/acc_bilanTest.class.php 
b/unit-test/include/class/acc_bilan.Test.php
similarity index 100%
rename from unit-test/include/class/acc_bilanTest.class.php
rename to unit-test/include/class/acc_bilan.Test.php
diff --git a/unit-test/include/class/acc_computeTest.class.php 
b/unit-test/include/class/acc_compute.Test.php
similarity index 100%
rename from unit-test/include/class/acc_computeTest.class.php
rename to unit-test/include/class/acc_compute.Test.php
diff --git a/unit-test/include/class/acc_ledgerTest.class.php 
b/unit-test/include/class/acc_ledger.Test.php
similarity index 100%
rename from unit-test/include/class/acc_ledgerTest.class.php
rename to unit-test/include/class/acc_ledger.Test.php
diff --git a/unit-test/include/class/acc_ledger_finTest.class.php 
b/unit-test/include/class/acc_ledger_fin.Test.php
similarity index 100%
rename from unit-test/include/class/acc_ledger_finTest.class.php
rename to unit-test/include/class/acc_ledger_fin.Test.php
diff --git a/unit-test/include/class/acc_ledger_historyTest.php 
b/unit-test/include/class/acc_ledger_historyTest.php
new file mode 100644
index 0000000..38f8d4e
--- /dev/null
+++ b/unit-test/include/class/acc_ledger_historyTest.php
@@ -0,0 +1,136 @@
+<?php
+
+use PHPUnit\Framework\TestCase;
+
+/*
+ *   This file is part of NOALYSS.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+// Copyright (2002-2019) Author Dany De Bontridder <address@hidden>
+
+/**
+ * @file
+ * @brief concerne acc_ledger_historyTest.class
+ * @coversDefaultClass Acc_Ledger_History
+ */
+class Acc_Ledger_HistoryTest extends TestCase
+{
+
+    /**
+     * Sets up the fixture, for example, opens a network connection.
+     * This method is called before a test is executed.
+     */
+    protected function setUp()
+    {
+        include 'global.php';
+    }
+
+    /**
+     * Tears down the fixture, for example, closes a network connection.
+     * This method is called after a test is executed.
+     */
+    protected function tearDown()
+    {
+        
+    }
+    /**
+     * @covers Acc_Ledger_History::factory
+     * @covers ::get_ledger_type
+     * @covers ::set_filter_operation
+     */
+    function testFactory()
+    {
+        global $g_connection;
+        $p_min_id=$g_connection->get_value("select p_id from parm_periode 
order by p_start limit 1");
+        $p_max_id=$g_connection->get_value("select p_id from parm_periode 
order by p_start desc limit 1");
+        
+        $object=Acc_Ledger_History::factory($g_connection, [1],$p_min_id 
,$p_max_id , "D", 'all');
+        $this->assertEquals('FIN',$object->get_ledger_type());
+
+        $object=Acc_Ledger_History::factory($g_connection, [4],$p_min_id 
,$p_max_id , "D", 'all');
+        $this->assertEquals('ODS',$object->get_ledger_type());
+        
+        $object=Acc_Ledger_History::factory($g_connection, [2],$p_min_id 
,$p_max_id , "D", 'all');
+        $this->assertEquals('VEN',$object->get_ledger_type());
+        
+        $object=Acc_Ledger_History::factory($g_connection, [3],$p_min_id 
,$p_max_id , "D", 'all');
+        $this->assertEquals('ACH',$object->get_ledger_type());
+        
+    }
+    /**
+    * @covers ::get_tiers
+    * @covers ::get_tiers_id
+    */
+    function testGet_tiers()
+    {
+        global $g_connection;
+        $p_min_id=$g_connection->get_value("select p_id from parm_periode 
order by p_start limit 1");
+        $p_max_id=$g_connection->get_value("select p_id from parm_periode 
order by p_start desc limit 1");
+
+        $object=Acc_Ledger_History::factory($g_connection, [1],$p_min_id 
,$p_max_id , "E", 'paid');
+        $this->assertEquals(" ",$object->get_tiers('ODS',213));
+
+        $this->assertEquals("Client 2",trim($object->get_tiers('VEN',213)));
+         
+         
+    }
+    /**
+     * @covers ::get_filter_operation
+     */
+    function testget_Filter_Operation()
+    {
+        global $g_connection;
+        $p_min_id=$g_connection->get_value("select p_id from parm_periode 
order by p_start limit 1");
+        $p_max_id=$g_connection->get_value("select p_id from parm_periode 
order by p_start desc limit 1");
+
+        $object=Acc_Ledger_History::factory($g_connection, [2],$p_min_id 
,$p_max_id , "D", 'all');
+        $this->assertEquals("all",$object->get_filter_operation()) ;
+
+        $object=Acc_Ledger_History::factory($g_connection, [3],$p_min_id 
,$p_max_id , "D", 'all');
+        $this->assertEquals("all",$object->get_filter_operation()) ;
+        
+        $object=Acc_Ledger_History::factory($g_connection, [1],$p_min_id 
,$p_max_id , "D", 'all');
+        $this->assertEquals("all",$object->get_filter_operation()) ;
+    }
+    /**
+     * @covers ::build_filter_operation
+     * @covers ::set_filter_operation
+     * 
+     */
+    function testBuild_filter_operation()
+    {
+        global $g_connection;
+        $p_min_id=$g_connection->get_value("select p_id from parm_periode 
order by p_start limit 1");
+        $p_max_id=$g_connection->get_value("select p_id from parm_periode 
order by p_start desc limit 1");
+        $object=Acc_Ledger_History::factory($g_connection, [2],$p_min_id 
,$p_max_id , "D", 'all');
+        $object->get_row();
+        $a_row=$object->get_data();
+        $this->assertEquals(7,count($a_row));
+        
+        $object->set_filter_operation("paid");
+        $object->get_row();
+        $a_row=$object->get_data();
+        $this->assertEquals(3,count($a_row));
+        
+        $object->set_filter_operation("unpaid");
+        $object->get_row();
+        $a_row=$object->get_data();
+        $this->assertEquals(4,count($a_row));
+
+        
+        }
+    
+}
\ No newline at end of file
diff --git a/unit-test/include/class/acc_ledger_history_financialTest.class.php 
b/unit-test/include/class/acc_ledger_history_financial.Test.php
similarity index 100%
rename from unit-test/include/class/acc_ledger_history_financialTest.class.php
rename to unit-test/include/class/acc_ledger_history_financial.Test.php
diff --git a/unit-test/include/class/acc_ledger_history_genericTest.class.php 
b/unit-test/include/class/acc_ledger_history_generic.Test.php
similarity index 100%
rename from unit-test/include/class/acc_ledger_history_genericTest.class.php
rename to unit-test/include/class/acc_ledger_history_generic.Test.php
diff --git a/unit-test/include/class/acc_ledger_history_purchaseTest.class.php 
b/unit-test/include/class/acc_ledger_history_purchase.Test.php
similarity index 100%
rename from unit-test/include/class/acc_ledger_history_purchaseTest.class.php
rename to unit-test/include/class/acc_ledger_history_purchase.Test.php
diff --git a/unit-test/include/class/acc_ledger_history_saleTest.class.php 
b/unit-test/include/class/acc_ledger_history_sale.Test.php
similarity index 100%
rename from unit-test/include/class/acc_ledger_history_saleTest.class.php
rename to unit-test/include/class/acc_ledger_history_sale.Test.php
diff --git a/unit-test/include/class/acc_ledger_infoTest.class.php 
b/unit-test/include/class/acc_ledger_info.Test.php
similarity index 100%
rename from unit-test/include/class/acc_ledger_infoTest.class.php
rename to unit-test/include/class/acc_ledger_info.Test.php
diff --git a/unit-test/include/class/acc_ledger_purchaseTest.class.php 
b/unit-test/include/class/acc_ledger_purchase.Test.php
similarity index 100%
rename from unit-test/include/class/acc_ledger_purchaseTest.class.php
rename to unit-test/include/class/acc_ledger_purchase.Test.php
diff --git a/unit-test/include/class/acc_ledger_soldTest.class.php 
b/unit-test/include/class/acc_ledger_sold.Test.php
similarity index 100%
rename from unit-test/include/class/acc_ledger_soldTest.class.php
rename to unit-test/include/class/acc_ledger_sold.Test.php
diff --git a/unit-test/include/class/acc_operationTest.class.php 
b/unit-test/include/class/acc_operation.Test.php
similarity index 100%
rename from unit-test/include/class/acc_operationTest.class.php
rename to unit-test/include/class/acc_operation.Test.php
diff --git a/unit-test/include/class/acc_parm_codeTest.class.php 
b/unit-test/include/class/acc_parm_code.Test.php
similarity index 100%
rename from unit-test/include/class/acc_parm_codeTest.class.php
rename to unit-test/include/class/acc_parm_code.Test.php
diff --git a/unit-test/include/class/anc_grandlivreTest.class.php 
b/unit-test/include/class/anc_grandlivre.Test.php
similarity index 100%
rename from unit-test/include/class/anc_grandlivreTest.class.php
rename to unit-test/include/class/anc_grandlivre.Test.php
diff --git a/unit-test/include/class/anc_keyTest.class.php 
b/unit-test/include/class/anc_key.Test.php
similarity index 100%
rename from unit-test/include/class/anc_keyTest.class.php
rename to unit-test/include/class/anc_key.Test.php
diff --git a/unit-test/include/class/anc_key_sqlTest.class.php 
b/unit-test/include/class/anc_key_sql.Test.php
similarity index 100%
rename from unit-test/include/class/anc_key_sqlTest.class.php
rename to unit-test/include/class/anc_key_sql.Test.php
diff --git a/unit-test/include/class/anc_operationTest.class.php 
b/unit-test/include/class/anc_operation.Test.php
similarity index 100%
rename from unit-test/include/class/anc_operationTest.class.php
rename to unit-test/include/class/anc_operation.Test.php
diff --git a/unit-test/include/class/dossierTest.class.php 
b/unit-test/include/class/dossier.Test.php
similarity index 100%
rename from unit-test/include/class/dossierTest.class.php
rename to unit-test/include/class/dossier.Test.php
diff --git a/unit-test/include/class/ficheTest.class.php 
b/unit-test/include/class/fiche.Test.php
similarity index 100%
rename from unit-test/include/class/ficheTest.class.php
rename to unit-test/include/class/fiche.Test.php
diff --git a/unit-test/include/class/noalyss_parameter_folderTest.class.php 
b/unit-test/include/class/noalyss_parameter_folder.Test.php
similarity index 100%
rename from unit-test/include/class/noalyss_parameter_folderTest.class.php
rename to unit-test/include/class/noalyss_parameter_folder.Test.php
diff --git a/unit-test/include/class/tax_summaryTest.class.php 
b/unit-test/include/class/tax_summary.Test.php
similarity index 100%
rename from unit-test/include/class/tax_summaryTest.class.php
rename to unit-test/include/class/tax_summary.Test.php
diff --git a/unit-test/include/class/userTest.class.php 
b/unit-test/include/class/user.Test.php
similarity index 98%
rename from unit-test/include/class/userTest.class.php
rename to unit-test/include/class/user.Test.php
index cbef9d6..727994c 100644
--- a/unit-test/include/class/userTest.class.php
+++ b/unit-test/include/class/user.Test.php
@@ -56,7 +56,6 @@ class UserTest extends TestCase
 
     /**
      * @covers User::load
-     * @todo   Implement testLoad().
      */
     public function testLoad()
     {
@@ -74,14 +73,9 @@ class UserTest extends TestCase
 
     /**
      * @covers User::save
-     * @todo   Implement testSave().
      */
     public function testSave()
     {
-        // Remove the following lines when you implement this test.
-        $this->markTestIncomplete(
-                'This test has not been implemented yet.'
-        );
     }
 
     /**
diff --git a/unit-test/test-file.sh b/unit-test/test-file.sh
index 166e801..2381d40 100755
--- a/unit-test/test-file.sh
+++ b/unit-test/test-file.sh
@@ -4,7 +4,11 @@ help(){
        echo "     -f filename , file to test"
        echo "     -i function , optional filter to a function"
 }
-PHPUNIT=./phpunit
+
+cd `dirname $0`
+
+CUR_DIR=`pwd`
+PHPUNIT=$CUR_DIR/phpunit
 FILETOTEST=""
 FUNCTION=""
 while getopts "f:i:" opt; do
@@ -34,11 +38,11 @@ fi
 
 if [ ! -z "$FUNCTION" ] ; then
        echo "testing $FILETOTEST $FUNCTION"
-       $PHPUNIT --bootstrap bootstrap.php --verbose --color --filter $FUNCTION 
$FILETOTEST
+       $PHPUNIT --bootstrap $CUR_DIR/bootstrap.php --verbose --color --filter 
$FUNCTION $FILETOTEST
 else
 
        # $PHPUNIT --bootstrap bootstrap.php --whitelist $FILETOTEST 
--coverage-text=${FILETOTEST%.php}.txt  --color $FILETOTEST 
-       $PHPUNIT --bootstrap bootstrap.php --whitelist=../include/class 
--coverage-html=coverage --color $FILETOTEST 
+       $PHPUNIT --bootstrap $CUR_DIR/bootstrap.php 
--whitelist=$CUR_DIR/../include/class --coverage-html=coverage --color 
$FILETOTEST 
        #$PHPUNIT --bootstrap bootstrap.php $FILETOTEST --testdox-html 
${FILETOTEST%.php}-testdox.html --color $FILETOTEST 
 fi
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]