noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 34/46: Typo , adapt unit-test


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 34/46: Typo , adapt unit-test
Date: Tue, 13 Jul 2021 05:02:00 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 8e353e9072395b220d6d4f7d01f9b756293b90ec
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sun Jun 20 13:30:39 2021 +0200

    Typo , adapt unit-test
---
 include/admin_repo.inc.php                        | 2 +-
 include/class/anc_account_table.class.php         | 4 ++--
 include/lib/database_core.class.php               | 2 +-
 unit-test/include/lib/table_sql_sqlTest.class.php | 6 ++++--
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/admin_repo.inc.php b/include/admin_repo.inc.php
index 9496e08..b47789b 100644
--- a/include/admin_repo.inc.php
+++ b/include/admin_repo.inc.php
@@ -113,7 +113,7 @@ if ( $action == "info" && SYSINFO_DISPLAY == true) {
     echo "<li>". "NOALYSS_HOME".": ".NOALYSS_HOME."</li>";
     echo "<li>"."NOALYSS_INCLUDE".": ".NOALYSS_INCLUDE."</li>";
     echo "<li>"."NOALYSS_TEMPLATE".": ".NOALYSS_TEMPLATE."</li>";
-    echo "<li>"."DEBUG".": ".DEBUG."</li>";
+    echo "<li>"."DEBUG".": ".DEBUGNOALYSS."</li>";
     echo "<li>"."LOGINPUT".": ".LOGINPUT."</li>";
     echo "<li>"."LOCALE".": ".LOCALE."</li>";
     echo "<li>"."MULTI".": ".MULTI."</li>";
diff --git a/include/class/anc_account_table.class.php 
b/include/class/anc_account_table.class.php
index 0363ddd..98ac210 100644
--- a/include/class/anc_account_table.class.php
+++ b/include/class/anc_account_table.class.php
@@ -57,8 +57,8 @@ class Anc_Account_Table extends Manage_Table_SQL
             pa_id=$1
             order by 2",0,array($p_table->pa_id));
         $this->set_col_type("po_state","select",array(
-                                            [ 
"value"=>"0",'label'=>_("Inactif")],
-                                            [ "value"=>"1","label"=>_("Actif")]
+                                            [ 
"value"=>"1","label"=>_("Actif")],
+                                            [ 
"value"=>"0",'label'=>_("Inactif")]
                                 ));
         
     }
diff --git a/include/lib/database_core.class.php 
b/include/lib/database_core.class.php
index 71de743..8b68149 100644
--- a/include/lib/database_core.class.php
+++ b/include/lib/database_core.class.php
@@ -53,7 +53,7 @@ class DatabaseCore
 
     function __construct($p_user, $p_password, $p_dbname, $p_host, $p_port)
     {
-        $this->db = pg_connect("dbname=$p_dbname host='$p_host' user='$p_user'
+        $this->db = @pg_connect("dbname=$p_dbname host='$p_host' user='$p_user'
                      password='$p_password' port=$p_port");
         if ($this->db == false) {
             if ( DEBUGNOALYSS > 0 ) {
diff --git a/unit-test/include/lib/table_sql_sqlTest.class.php 
b/unit-test/include/lib/table_sql_sqlTest.class.php
index adf15b9..f146c6c 100644
--- a/unit-test/include/lib/table_sql_sqlTest.class.php
+++ b/unit-test/include/lib/table_sql_sqlTest.class.php
@@ -79,6 +79,7 @@ VALUES(1, 'ACTIVITE', 'Activité commerciale Alchimerys sprl');
         $this->object->set("po_name", "Nouveau poste");
         $this->object->set("pa_id", "1");
         $this->object->set("po_amount", "0");
+        $this->object->set("po_state", "1");
         $this->object->save();
         $id=$this->object->get("po_id");
         $this->assertFalse(empty($id));
@@ -133,6 +134,7 @@ VALUES(1, 'ACTIVITE', 'Activité commerciale Alchimerys 
sprl');
         $this->object->set("po_name", "Nouveau poste");
         $this->object->set("pa_id", "1");
         $this->object->set("po_amount", "1250");
+        $this->object->set("po_state", "1");
         $this->object->save();
         $id=$this->object->get("po_id");
         $this->assertFalse(empty($id));
@@ -206,7 +208,7 @@ VALUES(1, 'ACTIVITE', 'Activité commerciale Alchimerys 
sprl');
     //@covers Noalyss_SQL::from_array
     public function testfrom_array()
     {
-        $this->object->from_array(["po_id"=>6, "po_name"=>"Test Unitaire", 
"po_description"=>"", "po_amount"=>0, "pa_id"=>1]);
+        $this->object->from_array(["po_id"=>6, "po_name"=>"Test Unitaire", 
"po_description"=>"", "po_amount"=>0, "pa_id"=>1,"po_state"=>0]);
         $this->object->insert();
         $this->object->load();
         $this->assertEquals($this->object->get("po_name"), "TESTUNITAIRE");
@@ -289,7 +291,7 @@ VALUES(1, 'ACTIVITE', 'Activité commerciale Alchimerys 
sprl');
     public function testbuild_query()
     {
         $str=$this->object->build_query();
-        $expected=" select po_id,po_name,pa_id,po_amount,po_description,ga_id 
from public.poste_analytique where po_id = $1";
+        $expected=" select 
po_id,po_name,pa_id,po_amount,po_description,ga_id,po_state from 
public.poste_analytique where po_id = $1";
         $this->assertEquals($str,$expected);
     }
 



reply via email to

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