[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
- [Noalyss-commit] [noalyss] branch unstable updated (26a3f802d -> 65dd4e31c), dwm, 2024/07/30
- [Noalyss-commit] [noalyss] 05/13: Documentation, dwm, 2024/07/30
- [Noalyss-commit] [noalyss] 01/13: Task 2370: Annonce Permettre l'insertion d'annonce dans la page de connection, dwm, 2024/07/30
- [Noalyss-commit] [noalyss] 07/13: bug : followup order, dwm, 2024/07/30
- [Noalyss-commit] [noalyss] 04/13: cosmetic : INPUT style, dwm, 2024/07/30
- [Noalyss-commit] [noalyss] 08/13: typo documentation, dwm, 2024/07/30
- [Noalyss-commit] [noalyss] 02/13: TVA_CODE : missing, dwm, 2024/07/30
- [Noalyss-commit] [noalyss] 11/13: Task #2373 : check security, dwm, 2024/07/30
- [Noalyss-commit] [noalyss] 12/13: Tax #2373 : add unit test,
dwm <=
- [Noalyss-commit] [noalyss] 10/13: Task #2373 : upgrade sql, dwm, 2024/07/30
- [Noalyss-commit] [noalyss] 03/13: Documentation + Tag::display, dwm, 2024/07/30
- [Noalyss-commit] [noalyss] 06/13: Ajax call check_vatnumber must no block, dwm, 2024/07/30
- [Noalyss-commit] [noalyss] 13/13: Documentation, dwm, 2024/07/30
- [Noalyss-commit] [noalyss] 09/13: Task #2373: Détail TVA : ajout detail TVA appelable depuis menu par P0TVA (récapitulatif TVA), dwm, 2024/07/30