noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 12/13: Tax #2373 : add unit test


From: dwm
Subject: [Noalyss-commit] [noalyss] 12/13: Tax #2373 : add unit test
Date: Tue, 30 Jul 2024 04:48:04 -0400 (EDT)

sparkyx pushed a commit to branch unstable
in repository noalyss.

commit cede8af91657315e53f5d223e78aaca06f270227
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Mon Jul 29 17:12:57 2024 +0200

    Tax #2373 : add unit test
---
 unit-test/include/class/tax_detail_test.php | 60 +++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/unit-test/include/class/tax_detail_test.php 
b/unit-test/include/class/tax_detail_test.php
new file mode 100644
index 000000000..18707de23
--- /dev/null
+++ b/unit-test/include/class/tax_detail_test.php
@@ -0,0 +1,60 @@
+<?php
+
+/*
+ * * Copyright (C) 2022 Dany De Bontridder <dany@alchimerys.be>
+ *
+ * This program 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.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * 
+ * Author : Dany De Bontridder danydb@noalyss.eu $(DATE)
+ */
+
+/**
+ * @file
+ * @brief noalyss
+ */
+
+use PHPUnit\Framework\TestCase;
+
+require DIRTEST . '/global.php';
+
+/**
+ * @testdox Class taxDetailTest.php : used for ...
+ * @backupGlobals enabled
+ * @coversDefaultClass
+ */
+class tax_Detail_Test extends TestCase
+{
+
+
+    /**
+     * @testdox check get_data
+     * @covers       Tax_Detail::get_data
+     * @backupGlobals enabled
+     */
+    function testGetData()
+    {
+        global $cn;
+        $cn=Dossier::connect();
+        $tax_detail=new \Tax_Detail(1, '01.01.2020', '31.12.2020',2);
+        $data=$tax_detail->get_data();
+        $this->assertEquals(9, count($data));
+        $sum=0;
+        foreach ($data as $item) $sum+=$item['vat_amount'];
+        $this->assertEquals(107.88, $sum);
+
+    }
+
+}
\ No newline at end of file



reply via email to

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