[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 15/34: Adaptation PHPUNIT
From: |
dwm |
Subject: |
[Noalyss-commit] [noalyss] 15/34: Adaptation PHPUNIT |
Date: |
Wed, 17 Jan 2024 12:54:06 -0500 (EST) |
sparkyx pushed a commit to branch devel
in repository noalyss.
commit 54015785121841f222e48ee64c8df846f3cb4cc3
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sat Jan 13 17:12:20 2024 +0100
Adaptation PHPUNIT
---
unit-test/include/class/acc_ledgerTest.php | 32 ----------------------
.../include/class/noalyss_parameter_folderTest.php | 1 +
.../{tax_summary.Test.php => tax_summaryTest.php} | 21 ++++++++++++--
3 files changed, 20 insertions(+), 34 deletions(-)
diff --git a/unit-test/include/class/acc_ledgerTest.php
b/unit-test/include/class/acc_ledgerTest.php
index e73dae402..be2aa1ce6 100644
--- a/unit-test/include/class/acc_ledgerTest.php
+++ b/unit-test/include/class/acc_ledgerTest.php
@@ -702,38 +702,6 @@ class Acc_LedgerTest extends TestCase
$this->assertEquals("3,2,4,5",$ledger->get_all_fiche_def());
}
- /**
- * @covers Acc_Ledger::get_saldo_exercice
- */
- public function testGet_saldo_exercice()
- {
- $result=[
- ["solde"=> 658.25 , "j_poste"=> "4400004", "j_qcode"=> "FOURNI"],
- ["solde"=> 660.17 , "j_poste"=> "4000005", "j_qcode"=> "CLIENT1"],
- ["solde"=> 87.8400, "j_poste"=> "4112", "j_qcode"=> ""],
- ["solde"=>-114.57 , "j_poste"=> "4511", "j_qcode"=> ""],
- ["solde"=> -1496.3400 , "j_poste"=>"4400005", "j_qcode"=>
"FOURNI1"]
- ];
- $get=$this->object->get_saldo_exercice("2018");
- $nb_get=count($get);
- $nb_result=count($result);
- $ix=0;
- for ($i=0;$i<$nb_get;$i++)
- {
- for ($e=0;$e<$nb_result;$e++) {
- if (
- $result[$e]["j_poste"] == $get[$i]["j_poste"] &&
- $result[$e]["j_qcode"] == $get[$i]["j_qcode"]
- )
- {
-
$this->assertEquals($result[$e]["solde"],$get[$i]["solde"]);
- $ix++;
- }
- }
- }
- $this->assertEquals(5,$ix);
- }
-
/**
* @covers Acc_Ledger::get_last_date
*/
diff --git a/unit-test/include/class/noalyss_parameter_folderTest.php
b/unit-test/include/class/noalyss_parameter_folderTest.php
index fae33f608..a98affd2b 100644
--- a/unit-test/include/class/noalyss_parameter_folderTest.php
+++ b/unit-test/include/class/noalyss_parameter_folderTest.php
@@ -66,6 +66,7 @@ class Noalyss_Parameter_FolderTest extends TestCase
"MY_ALPHANUM,".
"MY_UPDLAB,".
"MY_ANC_FILTER,".
+ "MY_REPORT,".
"MY_STOCK");
}
diff --git a/unit-test/include/class/tax_summary.Test.php
b/unit-test/include/class/tax_summaryTest.php
similarity index 94%
rename from unit-test/include/class/tax_summary.Test.php
rename to unit-test/include/class/tax_summaryTest.php
index 2e35860d4..7c45b4418 100644
--- a/unit-test/include/class/tax_summary.Test.php
+++ b/unit-test/include/class/tax_summaryTest.php
@@ -21,6 +21,8 @@ use PHPUnit\Framework\TestCase;
*/
// Copyright (2002-2019) Author Dany De Bontridder <danydb@noalyss.eu>
+require_once DIRTEST."/global.php";
+
/**
* @file
* @brief
@@ -40,6 +42,7 @@ class Tax_SummaryTest extends TestCase
protected function setUp():void
{
global $g_connection;
+ $g_connection=Dossier::connect();
$this->object=new \Tax_Summary($g_connection, "01.01.2014",
"31.12.2019");
}
@@ -70,6 +73,8 @@ class Tax_SummaryTest extends TestCase
function testDisplay()
{
+ global $g_connection,$g_user;
+ $g_user=new Noalyss_user($g_connection);
$this->expectOutputRegex("/.*0,00.*\<\/tr\>\<\/table\>\n/");
$this->object->display();
}
@@ -155,6 +160,9 @@ class Tax_SummaryTest extends TestCase
}
function testGet_row_purchase()
{
+ global $g_connection,$g_user;
+ $g_user=new Noalyss_user($g_connection);
+
// Operation date
$this->object->set_tva_type("O");
$array=$this->object->get_row_purchase();
@@ -185,7 +193,10 @@ class Tax_SummaryTest extends TestCase
function testGet_row_sale()
{
- $this->object->set_tva_type("O");
+ global $g_connection,$g_user;
+ $g_user=new Noalyss_user($g_connection);
+
+ $this->object->set_tva_type("O");
$array=$this->object->get_row_sale();
//-- For creating the array
Noalyss\Facility::save_file(__DIR__."/file",
"tax_summary_getrow_sale_o.txt", var_export($array, TRUE));
@@ -212,7 +223,10 @@ class Tax_SummaryTest extends TestCase
function testget_summary_purchase()
{
- $this->object->set_tva_type("T");
+ global $g_connection,$g_user;
+ $g_user=new Noalyss_user($g_connection);
+
+ $this->object->set_tva_type("T");
$array=$this->object->get_summary_purchase();
//-- For creating the array
Noalyss\Facility::save_file(__DIR__."/file",
"tax_summary_getsummary_purchase_t.txt", var_export($array, TRUE));
@@ -238,6 +252,9 @@ class Tax_SummaryTest extends TestCase
function testget_summary_sale()
{
+ global $g_connection,$g_user;
+ $g_user=new Noalyss_user($g_connection);
+
$this->object->set_tva_type("O");
$array=$this->object->get_summary_sale();
//-- For creating the array
- [Noalyss-commit] [noalyss] 18/34: Bug #0002322: Impression Suivi, (continued)
- [Noalyss-commit] [noalyss] 18/34: Bug #0002322: Impression Suivi, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 08/34: OPTION_CARD : Correct options for FollowUp, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 16/34: Task 2128 : Ouverture et cloture toujours visible, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 20/34: Merge branch 'devel-andromeda' into devel, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 28/34: Task 0002128: Clôture comptabilité française Réécriture op. ouverture et cloture, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 30/34: Get empty upgrade.sql, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 31/34: PRINT properly action, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 33/34: Task #2323 : follow-up correct depending action + cosmetic, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 09/34: Bug Fiche Option, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 12/34: Task 0002128: Clôture comptabilité française, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 15/34: Adaptation PHPUNIT,
dwm <=
- [Noalyss-commit] [noalyss] 03/34: Improve DBG , add stopwatch : timer_start and timer_show, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 10/34: PHP8.1 compatibility, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 14/34: Task 0002128: Clôture comptabilité française Réécriture op. ouverture et cloture, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 22/34: OPTION_CARD : Correct options for FollowUp, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 24/34: PHP8.1 compatibility, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 25/34: Task 0002128: Clôture comptabilité française, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 26/34: Task 0002128: Clôture comptabilité française, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 27/34: Acc OD : cosmetic, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 29/34: Adaptation PHPUNIT, dwm, 2024/01/17
- [Noalyss-commit] [noalyss] 34/34: Merge, dwm, 2024/01/17