[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 11/30: Improve Test and set the Patch level t
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 11/30: Improve Test and set the Patch level to 181 |
Date: |
Sat, 3 Dec 2022 08:35:07 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 6bd4f7217880d4513a290eda7a2bb059fc21ef06
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sun Nov 20 21:23:36 2022 +0100
Improve Test and set the Patch level to 181
---
include/class/fiche_def.class.php | 25 +++++++++++++------------
include/constant.php | 2 +-
unit-test/include/class/Fiche_DefTest.php | 22 ++++++++++++++++++++++
unit-test/include/class/contactTest.php | 2 +-
unit-test/include/lib/ac_commonTest.php | 2 +-
5 files changed, 38 insertions(+), 15 deletions(-)
diff --git a/include/class/fiche_def.class.php
b/include/class/fiche_def.class.php
index 9cec31ff5..3d169078f 100644
--- a/include/class/fiche_def.class.php
+++ b/include/class/fiche_def.class.php
@@ -121,8 +121,8 @@ class Fiche_Def
array($this->id));
*/
$sql="select * from fiche_def ".
- " where fd_id=".$this->id;
- $Ret=$this->cn->exec_sql($sql);
+ " where fd_id= $1";
+ $Ret=$this->cn->exec_sql($sql,[$this->id]);
if ( ($Max=Database::num_row($Ret)) == 0 )
return ;
$row=Database::fetch_array($Ret,0);
@@ -133,8 +133,7 @@ class Fiche_Def
$this->fd_description=$row['fd_description'];
}
/*!
- **************************************************
- * \brief Get all the fiche_def
+ * \brief Get all the fiche_def
*
* \return an array of fiche_def object
*/
@@ -144,17 +143,18 @@ class Fiche_Def
$Ret=$this->cn->exec_sql($sql);
if ( ($Max=Database::num_row($Ret)) == 0 )
- return ;
-
+ return array();
+ $all=array();
for ( $i = 0; $i < $Max;$i++)
{
$row=Database::fetch_array($Ret,$i);
- $this->all[$i]=new Fiche_Def($this->cn,$row['fd_id']);
- $this->all[$i]->label=$row['fd_label'];
- $this->all[$i]->class_base=$row['fd_class_base'];
- $this->all[$i]->fiche_def=$row['frd_id'];
- $this->all[$i]->create_account=$row['fd_create_account'];
+ $all[$i]=new Fiche_Def($this->cn,$row['fd_id']);
+ $all[$i]->label=$row['fd_label'];
+ $all[$i]->class_base=$row['fd_class_base'];
+ $all[$i]->fiche_def=$row['frd_id'];
+ $all[$i]->create_account=$row['fd_create_account'];
}
+ return $all;
}
/*!
**************************************************
@@ -196,7 +196,8 @@ $order
require_once NOALYSS_TEMPLATE.'/fiche_def_list.php';
}
- /*!\brief Add a fiche category thanks the element from the array
+ /*!
+ * \brief Add a fiche category thanks the element from the array
* you cannot add twice the same cat. name
* table : insert into fiche_def
* insert into attr_def
diff --git a/include/constant.php b/include/constant.php
index 4353f3926..73d32fdd3 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -116,7 +116,7 @@ if (!defined("NOALYSS_PACKAGE_REPOSITORY")) {
if (!defined("SYSINFO_DISPLAY")) {
define("SYSINFO_DISPLAY", TRUE);
}
-define("DBVERSION", 180);
+define("DBVERSION", 181);
define("MONO_DATABASE", 25);
define("DBVERSIONREPO", 20);
define('NOTFOUND', '--not found--');
diff --git a/unit-test/include/class/Fiche_DefTest.php
b/unit-test/include/class/Fiche_DefTest.php
index c7e95939f..03d0a2908 100644
--- a/unit-test/include/class/Fiche_DefTest.php
+++ b/unit-test/include/class/Fiche_DefTest.php
@@ -198,4 +198,26 @@ class Fiche_DefTest extends Testcase
$fiche_def->RemoveAttribut([20, 21, 22, 51, 52, 53]);
}
+ /**
+ @testdox get a Fiche_Def
+ */
+ function testGet()
+ {
+ global $g_connection;
+ $fiche_def=$this->getFicheDef();
+ $fiche_def->get();
+ $this->assertTrue($fiche_def->label=='Test.card',"Can not retrieve
label");
+ }
+
+ /**
+ @testdox get all Fiche_Def
+ */
+ function testGetAll()
+ {
+ global $g_connection;
+ $fiche_def=$this->getFicheDef();
+ $all=$fiche_def->get_all();
+ $this->assertEquals(count($all) , 8 ,"Retrieve an wrong number of
Fiche_Def");
+ }
+
}
diff --git a/unit-test/include/class/contactTest.php
b/unit-test/include/class/contactTest.php
index 2024c5b1a..5eae96dcb 100644
--- a/unit-test/include/class/contactTest.php
+++ b/unit-test/include/class/contactTest.php
@@ -180,7 +180,7 @@ class ContactTest extends TestCase
$filename="contact-summary-1.html";
\Noalyss\Facility::save_file($path,$filename,$r);
print "File saved into $path/$filename";
- $this->assertEquals(4988, filesize ($path."/".$filename)," File not
valide (1)");
+ $this->assertEquals(4988, filesize ($path."/".$filename)," File not
valide (1) $filename");
$this->assertEquals(5 , preg_match_all('/<tr class="/',$r)," 1.
Missing card");
$contact->filter_company(' fourni ');
ob_start();
diff --git a/unit-test/include/lib/ac_commonTest.php
b/unit-test/include/lib/ac_commonTest.php
index 6cdb60209..97646ca4b 100644
--- a/unit-test/include/lib/ac_commonTest.php
+++ b/unit-test/include/lib/ac_commonTest.php
@@ -1,4 +1,4 @@
-2<?php
+<?php
use PHPUnit\Framework\TestCase;
- [Noalyss-commit] [noalyss] 27/30: Cosmetic : move tags in operation details, small cosmetic bug, (continued)
- [Noalyss-commit] [noalyss] 27/30: Cosmetic : move tags in operation details, small cosmetic bug, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 03/30: Improve Debug info presentation, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 09/30: New #0002216: Transformation d'une dépense Gestion en facture achat ou note de frais, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 29/30: Cosmetic : color, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 28/30: cosmetic, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 30/30: Cosmetic, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 04/30: Show tag in operations list, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 08/30: To let TOOLS plugin to add tag to operation, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 01/30: Bug : no filter on card for ledger PURCHASE, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 05/30: Cosmetic : display cards on one row in account search, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 11/30: Improve Test and set the Patch level to 181,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 13/30: Better error message when cannot save a plugin, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 12/30: Fix : bug cannot save an empty FIN Ledger, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 14/30: Bug Fiche_Def->insertAttribut when needed to compute an attribute order, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 26/30: WHen creating from follow-up , keep a link to the event in the operation, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 24/30: Cosmetic, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 23/30: Comptability : Falkon doesn't understand the javascript token "??", Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 10/30: Bug : typo change by accident function name, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 16/30: Fix bug : prevent identical tags on operation, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 21/30: Change DB version, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 20/30: fix bug followup cannot add first comment, Dany De Bontridder, 2022/12/03