[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 03/04: PHP8 compatibility
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 03/04: PHP8 compatibility |
Date: |
Fri, 24 Dec 2021 08:49:40 -0500 (EST) |
sparkyx pushed a commit to branch devel
in repository noalyss.
commit ab13a65796dcab529c17970276913f9b4d5b6b6b
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Wed Dec 22 17:59:37 2021 +0100
PHP8 compatibility
---
html/securimage/securimage.php | 10 ++---
include/class/acc_account_ledger.class.php | 7 +++-
include/class/acc_ledger.class.php | 14 +++++--
include/class/acc_ledger_purchase.class.php | 2 +-
include/class/acc_report.class.php | 15 +++++++-
include/class/acc_tva.class.php | 6 ++-
include/class/card_property.class.php | 2 +-
include/class/database.class.php | 4 +-
include/class/document.class.php | 44 +++++++++++-----------
include/class/fiche.class.php | 9 ++++-
include/class/follow_up.class.php | 1 -
include/class/menu_ref.class.php | 8 +++-
include/class/pre_op_ach.class.php | 21 +++++++++--
include/class/pre_op_ven.class.php | 6 ++-
include/class/user.class.php | 5 ++-
include/lib/database_core.class.php | 24 ++++++------
include/lib/impress.class.php | 8 +++-
include/lib/table_data_sql.class.php | 8 +++-
unit-test/include/class/acc_account.Test.php | 2 +-
.../include/class/acc_account_ledger.Test.php | 4 +-
unit-test/include/class/acc_balance.Test.php | 4 +-
unit-test/include/class/acc_bilan.Test.php | 4 +-
unit-test/include/class/acc_compute.Test.php | 4 +-
unit-test/include/class/acc_ledger.Test.php | 8 ++--
unit-test/include/class/acc_ledger_fin.Test.php | 18 ++++-----
unit-test/include/class/acc_ledger_historyTest.php | 4 +-
.../class/acc_ledger_history_financial.Test.php | 4 +-
.../class/acc_ledger_history_generic.Test.php | 4 +-
.../class/acc_ledger_history_purchase.Test.php | 4 +-
.../include/class/acc_ledger_history_sale.Test.php | 4 +-
unit-test/include/class/acc_ledger_info.Test.php | 4 +-
.../include/class/acc_ledger_purchase.Test.php | 20 +++++-----
unit-test/include/class/acc_ledger_sale.Test.php | 16 ++++----
unit-test/include/class/acc_ledger_search.Test.php | 4 +-
unit-test/include/class/acc_letter.Test.php | 12 +++---
unit-test/include/class/acc_operation.Test.php | 4 +-
unit-test/include/class/acc_parm_code.Test.php | 4 +-
unit-test/include/class/acc_payment.Test.php | 2 +-
unit-test/include/class/anc_grandlivre.Test.php | 4 +-
unit-test/include/class/anc_group.Test.php | 12 +++---
unit-test/include/class/anc_key.Test.php | 8 ++--
unit-test/include/class/anc_key_sql.Test.php | 4 +-
unit-test/include/class/anc_operation.Test.php | 4 +-
unit-test/include/class/card_property.Test.php | 4 +-
unit-test/include/class/databaseTest.class.php | 4 +-
unit-test/include/class/document.Test.php | 12 +++---
unit-test/include/class/dossier.Test.php | 4 +-
unit-test/include/class/fiche.Test.php | 8 ++--
unit-test/include/class/fiche_def.Test.php | 6 +--
unit-test/include/class/followup_detail.Test.php | 12 +++---
unit-test/include/class/forecast.Test.php | 12 +++---
unit-test/include/class/impressTest.class.php | 4 +-
.../class/noalyss_parameter_folder.Test.php | 2 +-
unit-test/include/class/pdf_anc_acc_list.Test.php | 12 +++---
unit-test/include/class/periode.Test.php | 12 +++---
unit-test/include/class/print_LedgerTest.php | 4 +-
.../class/print_ledger_detail.classTest.php | 4 +-
.../class/print_ledger_detail_item.classTest.php | 4 +-
.../include/class/print_ledger_fin.classTest.php | 4 +-
.../include/class/print_ledger_misc.classTest.php | 4 +-
.../class/print_ledger_simple.classTest.php | 4 +-
.../print_ledger_simple_without_vat.classTest.php | 4 +-
.../include/class/print_operation_currencyTest.php | 10 ++---
unit-test/include/class/tax_summary.Test.php | 2 +-
unit-test/include/class/todo_list.Test.php | 8 ++--
unit-test/include/class/user.Test.php | 4 +-
unit-test/include/lib/databaseCore.Test.php | 4 +-
unit-test/include/lib/table_sql.Test.php | 4 +-
68 files changed, 287 insertions(+), 221 deletions(-)
diff --git a/html/securimage/securimage.php b/html/securimage/securimage.php
index 6d28607..046e352 100644
--- a/html/securimage/securimage.php
+++ b/html/securimage/securimage.php
@@ -873,7 +873,7 @@ class Securimage {
$font_color =
$this->gdtextcolor;
}
- $ch = $this->code{$i};
+ $ch = $this->code[$i];
imagettftext($this->tmpimg, $font_size,
$angle, $x, $y, $font_color, $this->ttf_file, $ch);
@@ -1002,7 +1002,7 @@ class Securimage {
$code = '';
for($i = 1, $cslen = strlen($this->charset); $i <= $len; ++$i) {
- $code .= $this->charset{rand(0, $cslen - 1)};
+ $code .= $this->charset[rand(0, $cslen - 1)];
}
return $code;
}
@@ -1094,7 +1094,7 @@ class Securimage {
}
for($i = 0; $i < strlen($code); ++$i) {
- $letters[] = $code{$i};
+ $letters[] = $code[$i];
}
if ($format == 'mp3') {
@@ -1301,10 +1301,10 @@ class Securimage {
$datalen = strlen($data) - $start - 256; // leave last 256
bytes unchanged
for ($i = $start; $i < $datalen; $i += 64) {
- $ch = ord($data{$i});
+ $ch = ord($data[$i]);
if ($ch < 9 || $ch > 119) continue;
- $data{$i} = chr($ch + rand(-8, 8));
+ $data[$i] = chr($ch + rand(-8, 8));
}
}
diff --git a/include/class/acc_account_ledger.class.php
b/include/class/acc_account_ledger.class.php
index 2595232..eee68a3 100644
--- a/include/class/acc_account_ledger.class.php
+++ b/include/class/acc_account_ledger.class.php
@@ -279,6 +279,8 @@ class Acc_Account_Ledger
*/
function get_solde($p_cond=" true ")
{
+ if (DEBUGNOALYSS > 1 ) { echo __CLASS__.".".__FUNCTION__."p_cond
{$p_cond}"; }
+
$Res=$this->db->exec_sql("select sum(deb) as sum_deb, sum(cred) as
sum_cred from
( select j_poste,
case when j_debit='t' then j_montant else 0
end as deb,
@@ -288,6 +290,7 @@ class Acc_Account_Ledger
j_poste::text like ('$this->id'::text) and
$p_cond
) as m ");
+ if (DEBUGNOALYSS > 1 ) { echo $this->db->get_sql(); }
$Max=Database::num_row($Res);
if ($Max==0) return 0;
$r=Database::fetch_array($Res,0);
@@ -302,8 +305,8 @@ class Acc_Account_Ledger
*/
function get_solde_detail($p_cond="")
{
-
if ( $p_cond != "") $p_cond=" and ".$p_cond;
+
$sql="select sum(deb) as sum_deb, sum(cred) as sum_cred from
( select j_poste,
case when j_debit='t' then j_montant else 0 end as deb,
@@ -313,7 +316,7 @@ class Acc_Account_Ledger
j_poste::text like ('$this->id'::text)
$p_cond
) as m ";
-
+ if (DEBUGNOALYSS > 1 ) { tracedebug("impress.debug.log", "$sql",
'acc_account_ledger:get_solde_detail'); }
$Res=$this->db->exec_sql($sql);
$Max=Database::num_row($Res);
diff --git a/include/class/acc_ledger.class.php
b/include/class/acc_ledger.class.php
index 5595479..fd1c6bf 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -1185,10 +1185,12 @@ class Acc_Ledger extends jrn_def_sql
{
$err=0;
- // Check the balance
- if (!isset(${'amount'.$i}))
+ // compatibily php 8.0 , if $amount is not a number then skip
+ if (!isset(${'amount'.$i}) || isNumber(${'amount'.$i})==0) {
continue;
-
+ }
+
+ // Check the balance
$amount=round(${'amount'.$i}, 2);
$tot_deb+=(isset(${'ck'.$i}))?$amount:0;
$tot_cred+=(!isset(${'ck'.$i}))?$amount:0;
@@ -1389,7 +1391,11 @@ class Acc_Ledger extends jrn_def_sql
// Save in currency
$operation_currency=new Operation_currency_SQL($this->db);
- $operation_currency->oc_amount=round(${'amount'.$i}, 2);
+ if (isNumber(${'amount'.$i}) == 0) {
+ $operation_currency->oc_amount=0;
+ }else {
+ $operation_currency->oc_amount=round(${'amount'.$i}, 2);
+ }
$operation_currency->oc_vat_amount=0;
$operation_currency->oc_price_unit=0;
$operation_currency->j_id=$j_id;
diff --git a/include/class/acc_ledger_purchase.class.php
b/include/class/acc_ledger_purchase.class.php
index aee5aeb..7133e37 100644
--- a/include/class/acc_ledger_purchase.class.php
+++ b/include/class/acc_ledger_purchase.class.php
@@ -167,7 +167,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
// Check if the given tva id is valid
if ( $g_parameter->MY_TVA_USE=='Y')
{
- if (${'e_march'.$i.'_tva_id'} == 0 )
+ if ( empty(${'e_march'.$i.'_tva_id'}) )
throw new Exception(_('La fiche ').${'e_march'.$i}._('a un
code tva invalide').' ['.${'e_march'.$i.'_tva_id'}.']',13);
$tva_rate=new Acc_Tva($this->db);
$tva_rate->set_parameter('id',${'e_march'.$i.'_tva_id'});
diff --git a/include/class/acc_report.class.php
b/include/class/acc_report.class.php
index 64fba8c..2e06c86 100644
--- a/include/class/acc_report.class.php
+++ b/include/class/acc_report.class.php
@@ -67,7 +67,9 @@ class Acc_Report
*/
function get_row($p_start,$p_end,$p_type_date)
{
-
+ if (DEBUGNOALYSS > 1) {
+
tracedebug("impress.debug.log",__FILE__."71.get_row({$p_start},{$p_end},{$p_type_date})");
+ }
$Res=$this->form_definition->cn->exec_sql("select fo_id ,
fo_fr_id,
fo_pos,
@@ -84,16 +86,25 @@ class Acc_Report
return null;
}
$col=array();
+
+ $a_type_date=["periode"=>0,"calendar"=>1];
+ if (array_key_exists($p_type_date, $a_type_date) )
+ {
+ $type_date=$a_type_date[$p_type_date];
+ } else {
+ throw new Exception("acr93 invalid type_date [ {$p_type_date} ] ");
+ }
for ($i=0;$i<$Max;$i++)
{
$l_line=Database::fetch_array($Res,$i);
+
$col[]=Impress::parse_formula($this->form_definition->cn,
$l_line['fo_label'],
$l_line['fo_formula'],
$p_start,
$p_end,
true,
- $p_type_date
+ $type_date
);
} //for ($i
diff --git a/include/class/acc_tva.class.php b/include/class/acc_tva.class.php
index 421544e..b9a14a4 100644
--- a/include/class/acc_tva.class.php
+++ b/include/class/acc_tva.class.php
@@ -46,7 +46,11 @@ class Acc_Tva
function __construct ($p_init,$p_tva_id=0)
{
$this->cn=$p_init;
- $this->tva_id=$p_tva_id;
+ if ( isNumber($p_tva_id)==1) {
+ $this->tva_id=$p_tva_id;
+ } else {
+ $this->tva_id=0;
+ }
$this->poste="";
$this->tva_label=null;
$this->tva_rate=0;
diff --git a/include/class/card_property.class.php
b/include/class/card_property.class.php
index 76617a7..d9fcf21 100644
--- a/include/class/card_property.class.php
+++ b/include/class/card_property.class.php
@@ -156,7 +156,7 @@ class Card_Property
join jnt_fic_attr on (jnt_fic_attr.fd_id=fiche.fd_id and
fiche_detail.ad_id=jnt_fic_attr.ad_id)
join attr_def on (attr_def.ad_id=fiche_detail.ad_id) where f_id=
$1".
" order by jnt_order";
-
+
$Ret=$fiche->cn->exec_sql($sql, [$fiche->id]);
if (($Max=Database::num_row($Ret))==0)
return;
diff --git a/include/class/database.class.php b/include/class/database.class.php
index 33918bb..f153f20 100644
--- a/include/class/database.class.php
+++ b/include/class/database.class.php
@@ -167,7 +167,7 @@ class Database extends DatabaseCore
// now we use sequence instead of computing a max
//
$Res2 = $this->exec_sql('select
coalesce(max(jr_grpt_id),1) as l from jrn');
- $Max2 = pg_NumRows($Res2);
+ $Max2 = pg_num_rows($Res2);
if ($Max2 == 1) {
$Row = pg_fetch_array($Res2, 0);
var_dump($Row);
@@ -192,7 +192,7 @@ class Database extends DatabaseCore
}
$sql = "select jrn_def_id from jrn_def ";
$Res = $this->exec_sql($sql);
- $Max = pg_NumRows($Res);
+ $Max = pg_num_rows($Res);
for ($seq = 0; $seq < $Max; $seq++) {
$row = pg_fetch_array($Res, $seq);
$sql = sprintf("select setval('s_jrn_%d',1,false)",
$row['jrn_def_id']);
diff --git a/include/class/document.class.php b/include/class/document.class.php
index 24a8734..6a84dd3 100644
--- a/include/class/document.class.php
+++ b/include/class/document.class.php
@@ -767,7 +767,7 @@ class Document
$tiers=new Fiche($this->db);
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode, false);
- $p=$tiers->strAttribut(ATTR_DEF_ACCOUNT);
+ $p=$tiers->strAttribut(ATTR_DEF_ACCOUNT,0);
$poste=new Acc_Account_Ledger($this->db, $p);
$r=$poste->get_solde(' true');
break;
@@ -775,13 +775,13 @@ class Document
$tiers=new Fiche($this->db);
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_NAME);
+ $r=$tiers->strAttribut(ATTR_DEF_NAME,0);
break;
case 'CUST_ADDR_1':
$tiers=new Fiche($this->db);
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_ADRESS);
+ $r=$tiers->strAttribut(ATTR_DEF_ADRESS,0);
break;
case 'CUST_CP':
@@ -789,7 +789,7 @@ class Document
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_CP);
+ $r=$tiers->strAttribut(ATTR_DEF_CP,0);
break;
case 'CUST_CITY':
@@ -797,7 +797,7 @@ class Document
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_CITY);
+ $r=$tiers->strAttribut(ATTR_DEF_CITY,0);
break;
@@ -806,7 +806,7 @@ class Document
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_PAYS);
+ $r=$tiers->strAttribut(ATTR_DEF_PAYS,0);
break;
// Marchandise in $p_array['e_march*']
@@ -816,25 +816,25 @@ class Document
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_NUMTVA);
+ $r=$tiers->strAttribut(ATTR_DEF_NUMTVA,0);
break;
case 'CUST_NUM':
$tiers=new Fiche($this->db);
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_NUMBER_CUSTOMER);
+ $r=$tiers->strAttribut(ATTR_DEF_NUMBER_CUSTOMER,0);
break;
case 'CUST_BANQUE_NO':
$tiers=new Fiche($this->db);
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_BQ_NO);
+ $r=$tiers->strAttribut(ATTR_DEF_BQ_NO,0);
break;
case 'CUST_BANQUE_NAME':
$tiers=new Fiche($this->db);
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_BQ_NAME);
+ $r=$tiers->strAttribut(ATTR_DEF_BQ_NAME,0);
break;
/*
--------------------------------------------------------------------------------
*/
/* BENEFIT (fee notes */
@@ -847,7 +847,7 @@ class Document
break;
}
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_NAME);
+ $r=$tiers->strAttribut(ATTR_DEF_NAME,0);
break;
case 'BENEF_ADDR_1':
$tiers=new Fiche($this->db);
@@ -858,7 +858,7 @@ class Document
break;
}
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_ADRESS);
+ $r=$tiers->strAttribut(ATTR_DEF_ADRESS,0);
break;
case 'BENEF_CP':
@@ -871,7 +871,7 @@ class Document
break;
}
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_CP);
+ $r=$tiers->strAttribut(ATTR_DEF_CP,0);
break;
case 'BENEF_CITY':
@@ -884,7 +884,7 @@ class Document
break;
}
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_CITY);
+ $r=$tiers->strAttribut(ATTR_DEF_CITY,0);
break;
@@ -898,7 +898,7 @@ class Document
break;
}
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_PAYS);
+ $r=$tiers->strAttribut(ATTR_DEF_PAYS,0);
break;
// Marchandise in $p_array['e_march*']
@@ -913,7 +913,7 @@ class Document
break;
}
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_NUMTVA);
+ $r=$tiers->strAttribut(ATTR_DEF_NUMTVA,0);
break;
case 'BENEF_NUM':
$tiers=new Fiche($this->db);
@@ -924,7 +924,7 @@ class Document
break;
}
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_NUMBER_CUSTOMER);
+ $r=$tiers->strAttribut(ATTR_DEF_NUMBER_CUSTOMER,0);
break;
case 'BENEF_BANQUE_NO':
$tiers=new Fiche($this->db);
@@ -935,7 +935,7 @@ class Document
break;
}
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_BQ_NO);
+ $r=$tiers->strAttribut(ATTR_DEF_BQ_NO,0);
break;
case 'BENEF_BANQUE_NAME':
$tiers=new Fiche($this->db);
@@ -946,7 +946,7 @@ class Document
break;
}
$tiers->get_by_qcode($qcode, false);
- $r=$tiers->strAttribut(ATTR_DEF_BQ_NAME);
+ $r=$tiers->strAttribut(ATTR_DEF_BQ_NAME,0);
break;
// Marchandise in $p_array['e_march*']
@@ -1019,7 +1019,7 @@ class Document
{
$f=new Fiche($this->db);
$f->get_by_qcode($p_array["e_march".$this->counter],
false);
- $r=$f->strAttribut(ATTR_DEF_NAME);
+ $r=$f->strAttribut(ATTR_DEF_NAME,0);
}
else
$r="";
@@ -1041,7 +1041,7 @@ class Document
{
$f=new Fiche($this->db);
$f->get_by_qcode($p_array[$id], false);
- $r=$f->strAttribut(ATTR_DEF_NAME);
+ $r=$f->strAttribut(ATTR_DEF_NAME,0);
}
else
$r="";
@@ -1062,7 +1062,7 @@ class Document
{
$f=new Fiche($this->db);
$f->get_by_qcode($p_array[$id], false);
- $r=$f->strAttribut(ATTR_DEF_STOCK);
+ $r=$f->strAttribut(ATTR_DEF_STOCK,0);
$r=($r==NOTFOUND)?'':$r;
}
}
diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php
index 79b263a..5a5558f 100644
--- a/include/class/fiche.class.php
+++ b/include/class/fiche.class.php
@@ -47,7 +47,14 @@ class Fiche
function __construct($p_cn,$p_id=0)
{
$this->cn=$p_cn;
- $this->id=$p_id;
+ // in PHP7 , a null string == 0
+ // in PHP8 , a null string == a null string and is not equal to 0
+ // to fix this, we set the fix here
+ if ( isNumber($p_id) == 1 ) {
+ $this->id=$p_id;
+ } else {
+ $this->id=0;
+ }
$this->quick_code='';
$this->attribut=array();
$this->f_enable='1';
diff --git a/include/class/follow_up.class.php
b/include/class/follow_up.class.php
index fe7f464..3b5a1ba 100644
--- a/include/class/follow_up.class.php
+++ b/include/class/follow_up.class.php
@@ -339,7 +339,6 @@ class Follow_Up
$ag_contact->name='ag_contact';
$ag_contact->value='';
$ag_contact->set_attribute('ipopup', 'ipopcard');
-
if ($this->ag_contact!=0)
{
$contact=new Fiche($this->db, $this->ag_contact);
diff --git a/include/class/menu_ref.class.php b/include/class/menu_ref.class.php
index 0a02e12..86cfd1e 100644
--- a/include/class/menu_ref.class.php
+++ b/include/class/menu_ref.class.php
@@ -34,6 +34,7 @@ class Menu_Ref extends Menu_Ref_SQL
$this->me_code=trim($this->me_code);
$this->me_code=str_replace('<','',$this->me_code);
$this->me_code=str_replace('>','',$this->me_code);
+
}
function verify()
{
@@ -42,12 +43,17 @@ class Menu_Ref extends Menu_Ref_SQL
parent::verify();
if ( $this->me_code == -1)
{
+ throw new Exception(_("le code ne peut être vide"));
+ }
$this->format_code();
if ( $this->cn->get_value("select count(*) from menu_ref where
me_code=$1",array($this->me_code)) > 0)
throw new Exception ('Doublon');
if (trim($this->me_code)=='')
throw new Exception ('Ce menu existe déjà');
- }
+ if (empty($this->me_code) ) {
+ throw new Exception(_("le code ne peut être vide"));
+ }
+
if ( ! file_exists('../include/'.$this->me_file)) throw new Exception
('Ce menu fichier '.$this->me_file." n'existe pas");
return 0;
diff --git a/include/class/pre_op_ach.class.php
b/include/class/pre_op_ach.class.php
index 0e6e59a..4716a99 100644
--- a/include/class/pre_op_ach.class.php
+++ b/include/class/pre_op_ach.class.php
@@ -45,12 +45,15 @@ class Pre_op_ach extends Pre_operation_detail
$march = "e_march" . $i;
$http->set_empty("");
$this->$march = $http->post('e_march' . $i);
- $this->{"e_march" . $i . "_tva_id"} = $http->post('e_march' . $i .
"_tva_id", "string", 0);
- $this->{"e_march" . $i . "_tva_id"} = $http->post('e_march' . $i .
"_tva_id", "string", "0");
$this->{"e_march" . $i . "_label"} = $http->post('e_march' . $i .
"_label", "string", "");
+
$http->set_empty(0);
+
+ $this->{"e_march" . $i . "_tva_id"} = $http->post('e_march' . $i .
"_tva_id", "string", 0);
+ $this->{"e_march" . $i . "_tva_id"} =(empty($this->{"e_march" . $i
. "_tva_id"}))?null:$this->{"e_march" . $i . "_tva_id"} ;
$this->{"e_march" . $i . "_price"} = $http->post('e_march' . $i .
"_price","number");
$this->{"e_march" . $i . "_tva_amount"} = $http->post('e_march' .
$i . "_tva_amount", "string", "0");
+ $this->{"e_march" . $i . "_tva_amount"} = (empty(
$this->{"e_march" . $i . "_tva_amount"} ))?0: $this->{"e_march" . $i .
"_tva_amount"} ;
$this->{"e_quant" . $i} = $http->post('e_quant' . $i, "number");
}
}
@@ -73,7 +76,7 @@ class Pre_op_ach extends Pre_operation_detail
for ($i=0;$i<$p_nb_item;$i++)
{
- if ( strlen(trim($this->{"e_march".$i}))=="") continue;
+ if ( strlen(trim($this->{"e_march".$i}))==0) continue;
$sql= 'insert into op_predef_detail (opd_poste,'
. 'opd_amount,'
. 'opd_tva_id,'
@@ -84,6 +87,16 @@ class Pre_op_ach extends Pre_operation_detail
. 'opd_comment'.
')'.
' values ($1,$2,$3,$4,$5,$6,$7,$8)';
+// if (DEBUGNOALYSS >2 ) {
+// var_dump(array($this->{"e_march".$i},
+// $this->{"e_march".$i."_price"},
+// $this->{"e_march".$i."_tva_id"},
+// $this->{"e_quant".$i},
+// 't',
+// $p_od_id,
+// $this->{"e_march".$i."_tva_amount"},
+// $this->{"e_march".$i."_label"}));
+// }
$this->db->exec_sql($sql,
array($this->{"e_march".$i},
$this->{"e_march".$i."_price"},
@@ -92,7 +105,7 @@ class Pre_op_ach extends Pre_operation_detail
't',
$p_od_id,
$this->{"e_march".$i."_tva_amount"},
- $this->{"e_march".$i."_label"},
+ $this->{"e_march".$i."_label"}
));
}
}
diff --git a/include/class/pre_op_ven.class.php
b/include/class/pre_op_ven.class.php
index 8190dd7..868ab82 100644
--- a/include/class/pre_op_ven.class.php
+++ b/include/class/pre_op_ven.class.php
@@ -48,12 +48,14 @@ class Pre_op_ven extends Pre_operation_detail
$http->set_empty("");
$this->$march=$http->post('e_march'.$i);
$this->{"e_march".$i."_tva_id"}=$http->post('e_march'.$i."_tva_id","string",0);
-
$this->{"e_march".$i."_tva_id"}=$http->post('e_march'.$i."_tva_id","string","0");
+ $this->{"e_march" . $i . "_tva_id"} =(empty($this->{"e_march" . $i
. "_tva_id"}))?0:$this->{"e_march" . $i . "_tva_id"} ;
+
$this->{"e_march".$i."_label"}=$http->post('e_march'.$i."_label","string","");
$http->set_empty(0);
$this->{"e_march".$i."_price"}=$http->post('e_march'.$i."_price","number");
$this->{"e_march".$i."_tva_amount"}=$http->post('e_march'.$i."_tva_amount","number","0");
+
$this->{"e_quant".$i}=$http->post('e_quant'.$i,"number");
}
}
@@ -75,7 +77,7 @@ class Pre_op_ven extends Pre_operation_detail
$this->db->exec_sql($sql);
for ($i=0;$i<$p_nb_item;$i++)
{
- if ( strlen(trim($this->{"e_march".$i}))=="") continue;
+ if ( strlen(trim($this->{"e_march".$i}))== 0 ) continue;
$sql= 'insert into op_predef_detail (opd_poste,'
. 'opd_amount,'
. 'opd_tva_id,'
diff --git a/include/class/user.class.php b/include/class/user.class.php
index 838b324..e1f9bec 100644
--- a/include/class/user.class.php
+++ b/include/class/user.class.php
@@ -107,14 +107,15 @@ class User
if ($this->load()==-1)
{
+ $cn=new Database();
echo '<h2 class="error">'._('Utilisateur ou mot de passe
incorrect').'</h2>';
$sql="insert into audit_connect
(ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
- $this->db->exec_sql($sql,
+ $cn->exec_sql($sql,
array($_SESSION[SESSION_KEY.'g_user'],
$_SERVER["REMOTE_ADDR"], "DISCON",
$_SERVER['REQUEST_URI'], 'FAIL'));
$this->clean_session();
redirect('logout.php', 1);
- exit();
+ exit();
}
$this->load_global_pref();
diff --git a/include/lib/database_core.class.php
b/include/lib/database_core.class.php
index d4c9b58..3a7e6be 100644
--- a/include/lib/database_core.class.php
+++ b/include/lib/database_core.class.php
@@ -192,8 +192,8 @@ class DatabaseCore
else
$this->ret = pg_query_params($this->db, $p_string,
$p_array);
}
- if (!$this->ret) {
- $str_error = pg_last_error($this->db) .
pg_result_error($this->ret);
+ if ($this->ret == false) {
+ $str_error = pg_last_error($this->db) ;
throw new Exception(" SQL ERROR $p_string " . $str_error, 1);
}
} catch (Exception $a) {
@@ -223,7 +223,7 @@ class DatabaseCore
function count_sql($p_sql, $p_array = null)
{
$r_sql = $this->exec_sql($p_sql, $p_array);
- return pg_NumRows($r_sql);
+ return pg_num_rows($r_sql);
}
/**
@@ -396,9 +396,9 @@ class DatabaseCore
function size($p_ret = null)
{
if ($p_ret == null)
- return pg_NumRows($this->ret);
+ return pg_num_rows($this->ret);
else
- return pg_NumRows($p_ret);
+ return pg_num_rows($p_ret);
}
/**
@@ -428,12 +428,12 @@ class DatabaseCore
{
try {
$this->ret = $this->exec_sql($p_sql, $p_array);
- $r = pg_NumRows($this->ret);
+ $r = pg_num_rows($this->ret);
if ($r == 0)
return "";
if ($r > 1) {
$array = pg_fetch_all($this->ret);
- throw new Exception("Attention $p_sql retourne " .
pg_NumRows($this->ret) . " valeurs " .
+ throw new Exception("Attention $p_sql retourne " .
pg_num_rows($this->ret) . " valeurs " .
var_export($p_array, true) . " values=" .
var_export($array, true));
}
$r = pg_fetch_row($this->ret, 0);
@@ -464,7 +464,7 @@ class DatabaseCore
{
$r = $this->exec_sql($p_sql, $p_array);
- if (pg_NumRows($r) == 0)
+ if (pg_num_rows($r) == 0)
return array();
$array = pg_fetch_all($r);
return $array;
@@ -662,7 +662,7 @@ class DatabaseCore
function make_array($p_sql, $p_null = 0, $p_array = null)
{
$a = $this->exec_sql($p_sql, $p_array);
- $max = pg_NumRows($a);
+ $max = pg_num_rows($a);
if ($max == 0 && $p_null == 0)
return null;
for ($i = 0; $i < $max; $i++) {
@@ -726,14 +726,14 @@ class DatabaseCore
return false;
}
- /**\brief wrapper for the function pg_NumRows
+ /**\brief wrapper for the function pg_num_rows
* \param $ret is the result of a exec_sql
* \return number of line affected
*/
static function num_row($ret)
{
- return pg_NumRows($ret);
+ return pg_num_rows($ret);
}
/**\brief wrapper for the function pg_fetch_array
@@ -1003,7 +1003,7 @@ class DatabaseCore
}
}
-
+
}
/* test::test_me(); */
diff --git a/include/lib/impress.class.php b/include/lib/impress.class.php
index 5de36f3..f7cae1d 100644
--- a/include/lib/impress.class.php
+++ b/include/lib/impress.class.php
@@ -60,14 +60,20 @@ class Impress
else
return $p_formula;
}
+ // Bug
+ // with PHP8 if ('periode'==0 ) echo "hello"; else echo
'different' ; => different
+ // with PHP7 if ('periode'==0 ) echo "hello"; else echo
'different' ; => hello
+
if ($p_type_date==0)
{
$cond=sql_filter_per($p_cn, $p_start, $p_end, 'p_id',
'j_tech_per');
$cond_anc= "and ".transform_sql_filter_per($cond);
}
- else {
+ elseif ($p_type_date == 1) {
$cond="( j_date >= to_date('$p_start','DD.MM.YYYY') and j_date <=
to_date('$p_end','DD.MM.YYYY'))";
$cond_anc="and ( oa_date >= to_date('$p_start','DD.MM.YYYY') and
oa_date <= to_date('$p_end','DD.MM.YYYY'))";
+ } else {
+ throw new Exception("impress72 invalid type_date [ {$p_type_date}
] ");
}
// ------------------- for accounting , analytic or
card-------------------------------------
diff --git a/include/lib/table_data_sql.class.php
b/include/lib/table_data_sql.class.php
index 51af6ad..763f848 100644
--- a/include/lib/table_data_sql.class.php
+++ b/include/lib/table_data_sql.class.php
@@ -109,7 +109,8 @@ abstract class Table_Data_SQL extends Data_SQL
{
if
(isset($this->default[$value])&&$this->default[$value]=="auto"&&$this->$value==null)
continue;
- if ($value==$this->primary_key&&$this->$value==-1)
+ // prob. with table when the pk is not auto.
+ if ($value==$this->primary_key && $this->$value==-1 &&
isset($this->default[$value]) )
continue;
$sql.=$sep.$value;
switch ($this->type[$value])
@@ -177,6 +178,11 @@ abstract class Table_Data_SQL extends Data_SQL
{
$sql=$this->build_query();
$pk=$this->primary_key;
+ // primary cannot be null or empty
+ if (trim($this->$pk)==="" || $this->$pk===null) {
+ $this->pk=-1;
+ return;
+ }
$result=$this->cn->get_array($sql,array ($this->$pk));
if ($this->cn->count()==0)
diff --git a/unit-test/include/class/acc_account.Test.php
b/unit-test/include/class/acc_account.Test.php
index 1a63207..4e289bc 100644
--- a/unit-test/include/class/acc_account.Test.php
+++ b/unit-test/include/class/acc_account.Test.php
@@ -16,7 +16,7 @@ class Acc_AccountTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
global $g_connection, $g_parameter, $g_user;
$_REQUEST['gDossier']=DOSSIER;
diff --git a/unit-test/include/class/acc_account_ledger.Test.php
b/unit-test/include/class/acc_account_ledger.Test.php
index 5824d70..9fb45eb 100644
--- a/unit-test/include/class/acc_account_ledger.Test.php
+++ b/unit-test/include/class/acc_account_ledger.Test.php
@@ -19,7 +19,7 @@ class Acc_Account_LedgerTest extends TestCase
* This method is called before a test is executed.
*
*/
- protected function setUp()
+ protected function setUp():void
{
global $g_connection, $g_parameter, $g_user;
$_REQUEST['gDossier']=DOSSIER;
@@ -34,7 +34,7 @@ class Acc_Account_LedgerTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/acc_balance.Test.php
b/unit-test/include/class/acc_balance.Test.php
index ab9b7f5..f048875 100644
--- a/unit-test/include/class/acc_balance.Test.php
+++ b/unit-test/include/class/acc_balance.Test.php
@@ -16,7 +16,7 @@ class Acc_BalanceTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
global $g_connection, $g_parameter,$g_user;
$_REQUEST['gDossier']=DOSSIER;
@@ -31,7 +31,7 @@ class Acc_BalanceTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/acc_bilan.Test.php
b/unit-test/include/class/acc_bilan.Test.php
index 217b178..e639484 100644
--- a/unit-test/include/class/acc_bilan.Test.php
+++ b/unit-test/include/class/acc_bilan.Test.php
@@ -17,7 +17,7 @@ class Acc_BilanTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
global $g_connection, $g_parameter;
$_REQUEST['gDossier']=DOSSIER;
@@ -32,7 +32,7 @@ class Acc_BilanTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/acc_compute.Test.php
b/unit-test/include/class/acc_compute.Test.php
index 8943332..87b90e1 100644
--- a/unit-test/include/class/acc_compute.Test.php
+++ b/unit-test/include/class/acc_compute.Test.php
@@ -16,7 +16,7 @@ class Acc_ComputeTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
$this->object=new Acc_Compute;
}
@@ -25,7 +25,7 @@ class Acc_ComputeTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/acc_ledger.Test.php
b/unit-test/include/class/acc_ledger.Test.php
index 92b89ec..214b52d 100644
--- a/unit-test/include/class/acc_ledger.Test.php
+++ b/unit-test/include/class/acc_ledger.Test.php
@@ -47,7 +47,7 @@ class Acc_LedgerTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
$this->object=new Acc_Ledger($g_connection,0);
@@ -57,7 +57,7 @@ class Acc_LedgerTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
@@ -379,7 +379,7 @@ class Acc_LedgerTest extends TestCase
$this->object->set_ledger_id(4);
$this->object->with_concerned=FALSE;
$ret=$this->object->confirm($array);
- $this->assertContains('td class="num">121,00<INPUT TYPE="hidden"
id="amount2" NAME="amount2" VALUE="121"></td></tr><tr class="highlight"><td
></td><td >Totaux</td><td class="num">121.00</td><td
class="num">121.00</td></tr></table><input type="button" class="button"
value="verifie Imputation Analytique" onClick="verify_ca(\'\');">',$ret);
+ $this->assertStringContainsString('td class="num">121,00<INPUT
TYPE="hidden" id="amount2" NAME="amount2" VALUE="121"></td></tr><tr
class="highlight"><td ></td><td >Totaux</td><td class="num">121.00</td><td
class="num">121.00</td></tr></table><input type="button" class="button"
value="verifie Imputation Analytique" onClick="verify_ca(\'\');">',$ret);
}
@@ -421,7 +421,7 @@ class Acc_LedgerTest extends TestCase
fwrite($fileresult,$str);
// fclose($fileresult);
- $this->assertContains('
onChange="format_number(this);checkTotalDirect()" ',
+ $this->assertStringContainsString('
onChange="format_number(this);checkTotalDirect()" ',
$str);
} catch (Exception $ex) {
$this->assertTrue(False);
diff --git a/unit-test/include/class/acc_ledger_fin.Test.php
b/unit-test/include/class/acc_ledger_fin.Test.php
index 69eeb34..8d7fef2 100644
--- a/unit-test/include/class/acc_ledger_fin.Test.php
+++ b/unit-test/include/class/acc_ledger_fin.Test.php
@@ -20,7 +20,7 @@ class Acc_Ledger_FinTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
$this->object=new Acc_Ledger_Fin($g_connection, 1);
@@ -75,7 +75,7 @@ class Acc_Ledger_FinTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
@@ -88,7 +88,7 @@ class Acc_Ledger_FinTest extends TestCase
public function testInput()
{
$result=$this->object->input($this->array);
- $this->assertContains("show_fin_chdate('chdate');",$result);
+
$this->assertStringContainsString("show_fin_chdate('chdate');",$result);
}
/**
@@ -104,9 +104,9 @@ class Acc_Ledger_FinTest extends TestCase
$array["last_sold"]="";
$array["mt"]="1572695340.6768";
$result=$this->object->confirm($array);
- $this->assertContains('<fieldset><legend>Banque, caisse </legend><div
id="jrn_name_div">',$result);
- $this->assertContains('<INPUT TYPE="hidden" id="dateop1"
NAME="dateop1" VALUE="">',$result);
- $this->assertContains('<INPUT TYPE="hidden" id="chdate" NAME="chdate"
VALUE="1">',$result);
+ $this->assertStringContainsString('<fieldset><legend>Banque, caisse
</legend><div id="jrn_name_div">',$result);
+ $this->assertStringContainsString('<INPUT TYPE="hidden" id="dateop1"
NAME="dateop1" VALUE="">',$result);
+ $this->assertStringContainsString('<INPUT TYPE="hidden" id="chdate"
NAME="chdate" VALUE="1">',$result);
}
@@ -155,9 +155,9 @@ class Acc_Ledger_FinTest extends TestCase
);
$this->clean_operation();
$ret=$this->object->insert($array);
- $this->assertContains('<table class="result" ><tr ><th
>Date</th>',$ret);
- $this->assertContains(' HREF="javascript:modifyOperation',$ret);
- $this->assertContains('-1.095,39',$ret);
+ $this->assertStringContainsString('<table class="result" ><tr ><th
>Date</th>',$ret);
+ $this->assertStringContainsString('
HREF="javascript:modifyOperation',$ret);
+ $this->assertStringContainsString('-1.095,39',$ret);
$this->clean_operation();
}
diff --git a/unit-test/include/class/acc_ledger_historyTest.php
b/unit-test/include/class/acc_ledger_historyTest.php
index 4d532ca..3c9a899 100644
--- a/unit-test/include/class/acc_ledger_historyTest.php
+++ b/unit-test/include/class/acc_ledger_historyTest.php
@@ -33,7 +33,7 @@ class Acc_Ledger_HistoryTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
}
@@ -42,7 +42,7 @@ class Acc_Ledger_HistoryTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/acc_ledger_history_financial.Test.php
b/unit-test/include/class/acc_ledger_history_financial.Test.php
index 8b736a0..29ea2eb 100644
--- a/unit-test/include/class/acc_ledger_history_financial.Test.php
+++ b/unit-test/include/class/acc_ledger_history_financial.Test.php
@@ -38,7 +38,7 @@ class Acc_Ledger_History_FinancialTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
global $g_connection;
@@ -49,7 +49,7 @@ class Acc_Ledger_History_FinancialTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/acc_ledger_history_generic.Test.php
b/unit-test/include/class/acc_ledger_history_generic.Test.php
index 5ca984a..211f6b6 100644
--- a/unit-test/include/class/acc_ledger_history_generic.Test.php
+++ b/unit-test/include/class/acc_ledger_history_generic.Test.php
@@ -37,7 +37,7 @@ class Acc_Ledger_History_GenericTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
global $g_connection;
@@ -48,7 +48,7 @@ class Acc_Ledger_History_GenericTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/acc_ledger_history_purchase.Test.php
b/unit-test/include/class/acc_ledger_history_purchase.Test.php
index 4be8ab9..8d5ed69 100644
--- a/unit-test/include/class/acc_ledger_history_purchase.Test.php
+++ b/unit-test/include/class/acc_ledger_history_purchase.Test.php
@@ -37,7 +37,7 @@ class Acc_Ledger_History_PurchaseTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
global $g_connection;
@@ -48,7 +48,7 @@ class Acc_Ledger_History_PurchaseTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/acc_ledger_history_sale.Test.php
b/unit-test/include/class/acc_ledger_history_sale.Test.php
index 8b130e9..7a8bb1f 100644
--- a/unit-test/include/class/acc_ledger_history_sale.Test.php
+++ b/unit-test/include/class/acc_ledger_history_sale.Test.php
@@ -37,7 +37,7 @@ class Acc_Ledger_History_SaleTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
global $g_connection;
@@ -48,7 +48,7 @@ class Acc_Ledger_History_SaleTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/acc_ledger_info.Test.php
b/unit-test/include/class/acc_ledger_info.Test.php
index ad06660..85cb9d3 100644
--- a/unit-test/include/class/acc_ledger_info.Test.php
+++ b/unit-test/include/class/acc_ledger_info.Test.php
@@ -37,7 +37,7 @@ class Acc_Ledger_InfoTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
global $g_connection;
@@ -48,7 +48,7 @@ class Acc_Ledger_InfoTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/acc_ledger_purchase.Test.php
b/unit-test/include/class/acc_ledger_purchase.Test.php
index 2607761..c7492d1 100644
--- a/unit-test/include/class/acc_ledger_purchase.Test.php
+++ b/unit-test/include/class/acc_ledger_purchase.Test.php
@@ -21,7 +21,7 @@ class Acc_Ledger_PurchaseTest extends TestCase
*/
private $array;
- static function setUpBeforeClass()
+ static function setUpBeforeClass():void
{
Acc_Ledger_PurchaseTest::setSpecialAttribute();
}
@@ -29,7 +29,7 @@ class Acc_Ledger_PurchaseTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
$this->object=new Acc_Ledger_Purchase($g_connection, 3);
@@ -71,11 +71,11 @@ class Acc_Ledger_PurchaseTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
- static function tearDownAfterClass()
+ static function tearDownAfterClass():void
{
require 'global.php';
global $g_connection;
@@ -328,11 +328,11 @@ class Acc_Ledger_PurchaseTest extends TestCase
\Noalyss\Facility::save_file(__DIR__."/file",
"acc_ledger_purchase_input.html",
\Noalyss\Facility::page_start().$res);
- $this->assertContains(
+ $this->assertStringContainsString(
'<OPTION VALUE="3" SELECTED>Achat',
$res);
- $this->assertContains('<INPUT TYPE="hidden" id="jrn_type"
NAME="jrn_type" VALUE="ACH"',$res);
- $this->assertContains('<td class="num"> <span id="tvac" >0.0</span>
</td>',$res);
+ $this->assertStringContainsString('<INPUT TYPE="hidden" id="jrn_type"
NAME="jrn_type" VALUE="ACH"',$res);
+ $this->assertStringContainsString('<td class="num"> <span id="tvac"
>0.0</span> </td>',$res);
}
@@ -347,9 +347,9 @@ class Acc_Ledger_PurchaseTest extends TestCase
\Noalyss\Facility::save_file(__DIR__."/file",
"acc_ledger_purchase_confirm.html",
\Noalyss\Facility::page_start().$ret);
- $this->assertContains('name="amount_t0" value="658.25"',$ret);
- $this->assertContains("value=\"Efface détail\"
onClick=\"anc_key_clean('25','','658.25','','','0');",$ret);
- $this->assertContains('NAME="e_quant0" VALUE="1">',$ret);
+ $this->assertStringContainsString('name="amount_t0"
value="658.25"',$ret);
+ $this->assertStringContainsString("value=\"Efface détail\"
onClick=\"anc_key_clean('25','','658.25','','','0');",$ret);
+ $this->assertStringContainsString('NAME="e_quant0" VALUE="1">',$ret);
}
private function clean_operation($p_internal='1572704002.1732')
diff --git a/unit-test/include/class/acc_ledger_sale.Test.php
b/unit-test/include/class/acc_ledger_sale.Test.php
index e932e10..029165e 100644
--- a/unit-test/include/class/acc_ledger_sale.Test.php
+++ b/unit-test/include/class/acc_ledger_sale.Test.php
@@ -24,7 +24,7 @@ class Acc_Ledger_SaleTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
$this->object=new Acc_Ledger_Sale($g_connection, 2);
@@ -76,7 +76,7 @@ class Acc_Ledger_SaleTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
@@ -178,11 +178,11 @@ class Acc_Ledger_SaleTest extends TestCase
\Noalyss\Facility::save_file(__DIR__."/file"
, "Acc_Ledger_Sale_confirm.html"
, \Noalyss\Facility::page_start().$res);
- $this->assertContains(
+ $this->assertStringContainsString(
'<input type="button" class="button" value="Vérifiez
Imputation Analytique" onClick="verify_ca(\'\');">',
$res);
- $this->assertContains('id="e_march1_tva_id" NAME="e_march1_tva_id"
VALUE="1"', $res);
- $this->assertContains("anc_key_choice(25,'t1',1212.5,'');", $res);
+ $this->assertStringContainsString('id="e_march1_tva_id"
NAME="e_march1_tva_id" VALUE="1"', $res);
+
$this->assertStringContainsString("anc_key_choice(25,'t1',1212.5,'');", $res);
}
@@ -206,12 +206,12 @@ class Acc_Ledger_SaleTest extends TestCase
\Noalyss\Facility::save_file(__DIR__."/file",
"Acc_Ledger_Sale_input.html",
\Noalyss\Facility::page_start().
$info);
- $this->assertContains(
+ $this->assertStringContainsString(
'NAME="e_client" ID="e_client" VALUE="CLIENT"
ondblclick="fill_ipopcard(this);" ', $info);
- $this->assertContains(
+ $this->assertStringContainsString(
'<INPUT TYPE="TEXT" class="input_text" id="e_pj" name="e_pj"
value="VEN10" placeholder="" title=""',
$info);
- $this->assertContains('ID="add_item" VALUE="ligne à ajouter"
onClick="ledger_add_multiple', $info);
+ $this->assertStringContainsString('ID="add_item" VALUE="ligne à
ajouter" onClick="ledger_add_multiple', $info);
}
diff --git a/unit-test/include/class/acc_ledger_search.Test.php
b/unit-test/include/class/acc_ledger_search.Test.php
index cb4e28e..313c1b4 100644
--- a/unit-test/include/class/acc_ledger_search.Test.php
+++ b/unit-test/include/class/acc_ledger_search.Test.php
@@ -40,7 +40,7 @@ class Acc_Ledger_Test extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
global $g_user;
@@ -51,7 +51,7 @@ class Acc_Ledger_Test extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/acc_letter.Test.php
b/unit-test/include/class/acc_letter.Test.php
index b5520c1..9bc18b0 100644
--- a/unit-test/include/class/acc_letter.Test.php
+++ b/unit-test/include/class/acc_letter.Test.php
@@ -44,7 +44,7 @@ class Acc_Letter extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test method is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
$this->a_column=array(
@@ -72,26 +72,26 @@ class Acc_Letter extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test method is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
/**
- * the setUpBeforeClass() template methods is called before the first test
of the test case
+ * the setUpBeforeClass():void template methods is called before the first
test of the test case
* class is run
*/
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass():void
{
include 'global.php';
}
/**
- * tearDownAfterClass() template methods is calleafter the last test of
the test case class is run,
+ * tearDownAfterClass():void template methods is calleafter the last test
of the test case class is run,
*
*/
- static function tearDownAfterClass()
+ static function tearDownAfterClass():void
{
// include 'global.php';
}
diff --git a/unit-test/include/class/acc_operation.Test.php
b/unit-test/include/class/acc_operation.Test.php
index d0b7271..a03d9af 100644
--- a/unit-test/include/class/acc_operation.Test.php
+++ b/unit-test/include/class/acc_operation.Test.php
@@ -15,7 +15,7 @@ class Acc_OperationTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
global $g_connection,$g_user;
@@ -28,7 +28,7 @@ class Acc_OperationTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/acc_parm_code.Test.php
b/unit-test/include/class/acc_parm_code.Test.php
index 988799c..2037205 100644
--- a/unit-test/include/class/acc_parm_code.Test.php
+++ b/unit-test/include/class/acc_parm_code.Test.php
@@ -16,7 +16,7 @@ class Acc_Parm_CodeTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
global $g_connection;
$_REQUEST['gDossier'] = DOSSIER;
@@ -28,7 +28,7 @@ class Acc_Parm_CodeTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/acc_payment.Test.php
b/unit-test/include/class/acc_payment.Test.php
index dfbc81a..ee201a5 100644
--- a/unit-test/include/class/acc_payment.Test.php
+++ b/unit-test/include/class/acc_payment.Test.php
@@ -46,7 +46,7 @@ class AccPaymentTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test method is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
}
diff --git a/unit-test/include/class/anc_grandlivre.Test.php
b/unit-test/include/class/anc_grandlivre.Test.php
index 404f5ec..5827601 100644
--- a/unit-test/include/class/anc_grandlivre.Test.php
+++ b/unit-test/include/class/anc_grandlivre.Test.php
@@ -16,7 +16,7 @@ class Anc_GrandLivreTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
global $g_connection;
}
@@ -25,7 +25,7 @@ class Anc_GrandLivreTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/anc_group.Test.php
b/unit-test/include/class/anc_group.Test.php
index 4d50ba5..99a7c18 100644
--- a/unit-test/include/class/anc_group.Test.php
+++ b/unit-test/include/class/anc_group.Test.php
@@ -42,7 +42,7 @@ class Anc_GroupTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test method is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
}
@@ -51,16 +51,16 @@ class Anc_GroupTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test method is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
/**
- * the setUpBeforeClass() template methods is called before the first test
of the test case
+ * the setUpBeforeClass():void template methods is called before the first
test of the test case
* class is run
*/
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass():void
{
include 'global.php';
global $g_connection;
@@ -72,10 +72,10 @@ class Anc_GroupTest extends TestCase
}
/**
- * tearDownAfterClass() template methods is calleafter the last test of
the test case class is run,
+ * tearDownAfterClass():void template methods is calleafter the last test
of the test case class is run,
*
*/
- static function tearDownAfterClass()
+ static function tearDownAfterClass():void
{
include 'global.php';
global $g_connection;
diff --git a/unit-test/include/class/anc_key.Test.php
b/unit-test/include/class/anc_key.Test.php
index 4562e85..79726d4 100644
--- a/unit-test/include/class/anc_key.Test.php
+++ b/unit-test/include/class/anc_key.Test.php
@@ -16,7 +16,7 @@ class Anc_KeyTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
}
@@ -25,11 +25,11 @@ class Anc_KeyTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
- static function setUpBeforeClass()
+ static function setUpBeforeClass():void
{
// require_once 'global.php';
//
@@ -37,7 +37,7 @@ class Anc_KeyTest extends TestCase
// $g_connection=Dossier::connect();
}
- static function tearDownAfterClass()
+ static function tearDownAfterClass():void
{
}
diff --git a/unit-test/include/class/anc_key_sql.Test.php
b/unit-test/include/class/anc_key_sql.Test.php
index ef11581..aaf1b7a 100644
--- a/unit-test/include/class/anc_key_sql.Test.php
+++ b/unit-test/include/class/anc_key_sql.Test.php
@@ -17,7 +17,7 @@ class Anc_Key_Detail_SQLTest extends TestCase
* This method is called before a test is executed.
* @backupGlobals enabled
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
$this->object=new Anc_Key_Detail_SQL($g_connection);
@@ -27,7 +27,7 @@ class Anc_Key_Detail_SQLTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/anc_operation.Test.php
b/unit-test/include/class/anc_operation.Test.php
index b29da82..c2ce425 100644
--- a/unit-test/include/class/anc_operation.Test.php
+++ b/unit-test/include/class/anc_operation.Test.php
@@ -16,7 +16,7 @@ class Anc_OperationTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
// $this->object=new Anc_Operation;
}
@@ -25,7 +25,7 @@ class Anc_OperationTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/card_property.Test.php
b/unit-test/include/class/card_property.Test.php
index 0085cc2..4c66b3c 100644
--- a/unit-test/include/class/card_property.Test.php
+++ b/unit-test/include/class/card_property.Test.php
@@ -41,7 +41,7 @@ class Card_PropertyTest extends TestCase
* @brief
* @global type $g_connection
*/
- static function setUpBeforeClass()
+ static function setUpBeforeClass():void
{
require_once 'global.php';
global $g_connection;
@@ -86,7 +86,7 @@ class Card_PropertyTest extends TestCase
$fiche->load();
}
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass():void
{
require_once 'global.php';
global $g_connection;
diff --git a/unit-test/include/class/databaseTest.class.php
b/unit-test/include/class/databaseTest.class.php
index 084986f..b9c4a50 100644
--- a/unit-test/include/class/databaseTest.class.php
+++ b/unit-test/include/class/databaseTest.class.php
@@ -17,7 +17,7 @@ class DatabaseTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
$this->object=new Database(DOSSIER);
}
@@ -26,7 +26,7 @@ class DatabaseTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/document.Test.php
b/unit-test/include/class/document.Test.php
index 6bb7f06..4f684ca 100644
--- a/unit-test/include/class/document.Test.php
+++ b/unit-test/include/class/document.Test.php
@@ -35,7 +35,7 @@ class DocumentTest extends TestCase
*/
private $document;
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass():void
{
// insert a document_modele
$cn=Dossier::connect();
@@ -56,7 +56,7 @@ class DocumentTest extends TestCase
$cn->commit();
}
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass():void
{
// clean database
$cn=Dossier::connect();
@@ -76,7 +76,7 @@ class DocumentTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
}
@@ -85,7 +85,7 @@ class DocumentTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
@@ -111,6 +111,8 @@ class DocumentTest extends TestCase
function testReplace()
{
$cn=Dossier::connect();
+ global $g_parameter;
+ $g_parameter=new Noalyss_Parameter_Folder($cn);
$document=new Document($cn);
$array=[];
$array['e_client']='CLIENT';
@@ -157,7 +159,7 @@ class DocumentTest extends TestCase
$cnt_before=$cn->get_value("select count(*) from document");
$tEnv=$_ENV['TMP'];
$_ENV['TMP']='/not.exist';
- $this->assertContains ('échoué',$document->generate($array));
+ $this->assertStringContainsString
('échoué',$document->generate($array));
$_ENV['TMP']= $tEnv;
}
diff --git a/unit-test/include/class/dossier.Test.php
b/unit-test/include/class/dossier.Test.php
index f0d6273..3e06982 100644
--- a/unit-test/include/class/dossier.Test.php
+++ b/unit-test/include/class/dossier.Test.php
@@ -17,7 +17,7 @@ class DossierTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
require_once 'global.php';
$this->object=new Dossier(DOSSIER);
@@ -27,7 +27,7 @@ class DossierTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/fiche.Test.php
b/unit-test/include/class/fiche.Test.php
index 6e29f71..2821e4e 100644
--- a/unit-test/include/class/fiche.Test.php
+++ b/unit-test/include/class/fiche.Test.php
@@ -20,7 +20,7 @@ class FicheTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
$this->object = new Fiche($g_connection);
@@ -30,12 +30,12 @@ class FicheTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
- static function tearDownAfterClass()
+ static function tearDownAfterClass():void
{
include 'global.php';
$fiche_def = new Fiche_Def($g_connection, 5);
@@ -133,7 +133,7 @@ class FicheTest extends TestCase
$this->assertEquals('', $r);
$this->object->fiche_def_ref = 9;
$r = $this->object->summary();
- $this->assertContains('</TABLE>', $r);
+ $this->assertStringContainsString('</TABLE>', $r);
}
/**
diff --git a/unit-test/include/class/fiche_def.Test.php
b/unit-test/include/class/fiche_def.Test.php
index dc67e34..0751bec 100644
--- a/unit-test/include/class/fiche_def.Test.php
+++ b/unit-test/include/class/fiche_def.Test.php
@@ -35,7 +35,7 @@ class Fiche_DefTest extends Testcase
protected $fiche_def;
- static function setUpBeforeClass()
+ static function setUpBeforeClass():void
{
require_once 'global.php';
@@ -58,7 +58,7 @@ class Fiche_DefTest extends Testcase
* @brief clean after testing it
* @global type $g_connection
*/
- static function tearDownAfterClass()
+ static function tearDownAfterClass():void
{
require_once 'global.php';
global $g_connection;
@@ -74,7 +74,7 @@ class Fiche_DefTest extends Testcase
$g_connection->exec_sql("delete from fiche_def where fd_id=$1",
[$fd_id]);
}
}
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
}
diff --git a/unit-test/include/class/followup_detail.Test.php
b/unit-test/include/class/followup_detail.Test.php
index 60c6675..355876c 100644
--- a/unit-test/include/class/followup_detail.Test.php
+++ b/unit-test/include/class/followup_detail.Test.php
@@ -46,7 +46,7 @@ class Follow_Up_DetailTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test method is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
}
@@ -55,26 +55,26 @@ class Follow_Up_DetailTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test method is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
/**
- * the setUpBeforeClass() template methods is called before the first test
of the test case
+ * the setUpBeforeClass():void template methods is called before the first
test of the test case
* class is run
*/
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass():void
{
global $g_connection;
$g_connection->exec_sql('delete from action_detail');
}
/**
- * tearDownAfterClass() template methods is calleafter the last test of
the test case class is run,
+ * tearDownAfterClass():void template methods is calleafter the last test
of the test case class is run,
*
*/
- static function tearDownAfterClass()
+ static function tearDownAfterClass():void
{
// include 'global.php';
}
diff --git a/unit-test/include/class/forecast.Test.php
b/unit-test/include/class/forecast.Test.php
index 8e85b5e..9b49dba 100644
--- a/unit-test/include/class/forecast.Test.php
+++ b/unit-test/include/class/forecast.Test.php
@@ -46,7 +46,7 @@ class ForecastTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test method is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
}
@@ -55,16 +55,16 @@ class ForecastTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test method is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
/**
- * the setUpBeforeClass() template methods is called before the first test
of the test case
+ * the setUpBeforeClass():void template methods is called before the first
test of the test case
* class is run
*/
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass():void
{
include 'global.php';
global $g_connection;
@@ -72,10 +72,10 @@ class ForecastTest extends TestCase
}
/**
- * tearDownAfterClass() template methods is calleafter the last test of
the test case class is run,
+ * tearDownAfterClass():void template methods is calleafter the last test
of the test case class is run,
*
*/
- static function tearDownAfterClass()
+ static function tearDownAfterClass():void
{
// include 'global.php';
}
diff --git a/unit-test/include/class/impressTest.class.php
b/unit-test/include/class/impressTest.class.php
index c5ea2a7..a429668 100644
--- a/unit-test/include/class/impressTest.class.php
+++ b/unit-test/include/class/impressTest.class.php
@@ -39,7 +39,7 @@ class ImpressTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
}
@@ -48,7 +48,7 @@ class ImpressTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/noalyss_parameter_folder.Test.php
b/unit-test/include/class/noalyss_parameter_folder.Test.php
index ca37a58..10cbe3a 100644
--- a/unit-test/include/class/noalyss_parameter_folder.Test.php
+++ b/unit-test/include/class/noalyss_parameter_folder.Test.php
@@ -37,7 +37,7 @@ class Noalyss_Parameter_FolderTest extends TestCase
* This method is called before a test is executed.
*
*/
- protected function setUp()
+ protected function setUp():void
{
global $g_connection, $g_user;
$_REQUEST['gDossier']=DOSSIER;
diff --git a/unit-test/include/class/pdf_anc_acc_list.Test.php
b/unit-test/include/class/pdf_anc_acc_list.Test.php
index 1bd8067..f043f8a 100644
--- a/unit-test/include/class/pdf_anc_acc_list.Test.php
+++ b/unit-test/include/class/pdf_anc_acc_list.Test.php
@@ -45,7 +45,7 @@ class PDF_Anc_Acc_ListTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test method is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
@@ -55,16 +55,16 @@ class PDF_Anc_Acc_ListTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test method is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
/**
- * the setUpBeforeClass() template methods is called before the first test
of the test case
+ * the setUpBeforeClass():void template methods is called before the first
test of the test case
* class is run
*/
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass():void
{
include 'global.php';
// insert data into operation_analytique
@@ -93,10 +93,10 @@ EOF;
}
/**
- * tearDownAfterClass() template methods is calleafter the last test of
the test case class is run,
+ * tearDownAfterClass():void template methods is calleafter the last test
of the test case class is run,
*
*/
- static function tearDownAfterClass()
+ static function tearDownAfterClass():void
{
include 'global.php';
global $g_connection;
diff --git a/unit-test/include/class/periode.Test.php
b/unit-test/include/class/periode.Test.php
index f0a3edb..1b9cd1f 100644
--- a/unit-test/include/class/periode.Test.php
+++ b/unit-test/include/class/periode.Test.php
@@ -45,7 +45,7 @@ class PeriodeTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test method is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
}
@@ -54,25 +54,25 @@ class PeriodeTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test method is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
/**
- * the setUpBeforeClass() template methods is called before the first test
of the test case
+ * the setUpBeforeClass():void template methods is called before the first
test of the test case
* class is run
*/
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass():void
{
// include 'global.php';
}
/**
- * tearDownAfterClass() template methods is calleafter the last test of
the test case class is run,
+ * tearDownAfterClass():void template methods is calleafter the last test
of the test case class is run,
*
*/
- static function tearDownAfterClass()
+ static function tearDownAfterClass():void
{
// include 'global.php';
}
diff --git a/unit-test/include/class/print_LedgerTest.php
b/unit-test/include/class/print_LedgerTest.php
index c8447a5..ad1ea84 100644
--- a/unit-test/include/class/print_LedgerTest.php
+++ b/unit-test/include/class/print_LedgerTest.php
@@ -38,7 +38,7 @@ class print_LedgerTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
// Exercice 2018
@@ -50,7 +50,7 @@ class print_LedgerTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/print_ledger_detail.classTest.php
b/unit-test/include/class/print_ledger_detail.classTest.php
index 769e486..39d14da 100644
--- a/unit-test/include/class/print_ledger_detail.classTest.php
+++ b/unit-test/include/class/print_ledger_detail.classTest.php
@@ -40,7 +40,7 @@ class Print_Ledger_DetailTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
$this->from=92;
$this->to=103;
@@ -50,7 +50,7 @@ class Print_Ledger_DetailTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
diff --git a/unit-test/include/class/print_ledger_detail_item.classTest.php
b/unit-test/include/class/print_ledger_detail_item.classTest.php
index ff5b963..2d3bf7d 100644
--- a/unit-test/include/class/print_ledger_detail_item.classTest.php
+++ b/unit-test/include/class/print_ledger_detail_item.classTest.php
@@ -38,7 +38,7 @@ class Print_Ledger_Detail_ItemTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
$this->from=92;
@@ -49,7 +49,7 @@ class Print_Ledger_Detail_ItemTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/print_ledger_fin.classTest.php
b/unit-test/include/class/print_ledger_fin.classTest.php
index 8c63778..e51bf1d 100644
--- a/unit-test/include/class/print_ledger_fin.classTest.php
+++ b/unit-test/include/class/print_ledger_fin.classTest.php
@@ -38,7 +38,7 @@ class Print_Ledger_FinTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
$this->from=92;
@@ -49,7 +49,7 @@ class Print_Ledger_FinTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/print_ledger_misc.classTest.php
b/unit-test/include/class/print_ledger_misc.classTest.php
index 938ca76..100a978 100644
--- a/unit-test/include/class/print_ledger_misc.classTest.php
+++ b/unit-test/include/class/print_ledger_misc.classTest.php
@@ -37,7 +37,7 @@ class Print_Ledger_MiscTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
// Exercice 2018
@@ -49,7 +49,7 @@ class Print_Ledger_MiscTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/print_ledger_simple.classTest.php
b/unit-test/include/class/print_ledger_simple.classTest.php
index 6877977..6a0667b 100644
--- a/unit-test/include/class/print_ledger_simple.classTest.php
+++ b/unit-test/include/class/print_ledger_simple.classTest.php
@@ -38,7 +38,7 @@ class print_ledger_simpleTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
// Exercice 2018
@@ -50,7 +50,7 @@ class print_ledger_simpleTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git
a/unit-test/include/class/print_ledger_simple_without_vat.classTest.php
b/unit-test/include/class/print_ledger_simple_without_vat.classTest.php
index 2081766..18c35d1 100644
--- a/unit-test/include/class/print_ledger_simple_without_vat.classTest.php
+++ b/unit-test/include/class/print_ledger_simple_without_vat.classTest.php
@@ -38,7 +38,7 @@ class Print_Ledger_Simple_Without_VatTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
// Exercice 2018
@@ -50,7 +50,7 @@ class Print_Ledger_Simple_Without_VatTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/class/print_operation_currencyTest.php
b/unit-test/include/class/print_operation_currencyTest.php
index 5e651a2..7c54beb 100644
--- a/unit-test/include/class/print_operation_currencyTest.php
+++ b/unit-test/include/class/print_operation_currencyTest.php
@@ -29,7 +29,7 @@ use PHPUnit\Framework\TestCase;
class Print_Operation_CurrencyTest extends TestCase
{
- protected function setUp()
+ protected function setUp():void
{
include 'global.php';
@@ -52,7 +52,7 @@ class Print_Operation_CurrencyTest extends TestCase
$card_category);
$sql=$object->SQL_Condition();
- $this->assertContains(" and jrnx.f_id in ( select f_id from fiche
where fd_id=$4)",$sql);
+ $this->assertStringContainsString(" and jrnx.f_id in ( select f_id
from fiche where fd_id=$4)",$sql);
$array=$object->get_data();
$this->assertEquals(count($array),0,"operation in EURO");
@@ -80,7 +80,7 @@ class Print_Operation_CurrencyTest extends TestCase
);
$sql=$object->SQL_Condition();
- $this->assertContains("where jrn.currency_id = $1 and",$sql);
+ $this->assertStringContainsString("where jrn.currency_id = $1
and",$sql);
$array=$object->get_data();
$this->assertEquals(0,count($array),"operation in EURO");
@@ -107,7 +107,7 @@ class Print_Operation_CurrencyTest extends TestCase
$card);
$sql=$object->SQL_Condition();
- $this->assertContains("and f_id=$4",$sql);
+ $this->assertStringContainsString("and f_id=$4",$sql);
$array=$object->get_data();
$this->assertEquals(0,count($array),"operation in EURO");
@@ -137,7 +137,7 @@ class Print_Operation_CurrencyTest extends TestCase
$to_poste);
$sql=$object->SQL_Condition();
- $this->assertContains("and j_poste >= $4 and j_poste <= $5",$sql);
+ $this->assertStringContainsString("and j_poste >= $4 and j_poste <=
$5",$sql);
$array=$object->get_data();
$this->assertEquals(0,count($array),"operation in EURO");
diff --git a/unit-test/include/class/tax_summary.Test.php
b/unit-test/include/class/tax_summary.Test.php
index 43bdd91..2e35860 100644
--- a/unit-test/include/class/tax_summary.Test.php
+++ b/unit-test/include/class/tax_summary.Test.php
@@ -37,7 +37,7 @@ class Tax_SummaryTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp(): void
+ protected function setUp():void
{
global $g_connection;
$this->object=new \Tax_Summary($g_connection, "01.01.2014",
"31.12.2019");
diff --git a/unit-test/include/class/todo_list.Test.php
b/unit-test/include/class/todo_list.Test.php
index c337374..73afe32 100644
--- a/unit-test/include/class/todo_list.Test.php
+++ b/unit-test/include/class/todo_list.Test.php
@@ -46,7 +46,7 @@ class Todo_ListTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test method is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
}
@@ -54,16 +54,16 @@ class Todo_ListTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test method is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
/**
- * the setUpBeforeClass() template methods is called before the first test
of the test case
+ * the setUpBeforeClass():void template methods is called before the first
test of the test case
* class is run
*/
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass():void
{
require 'global.php';
global $g_connection;
diff --git a/unit-test/include/class/user.Test.php
b/unit-test/include/class/user.Test.php
index d1623e3..4ee68bb 100644
--- a/unit-test/include/class/user.Test.php
+++ b/unit-test/include/class/user.Test.php
@@ -28,7 +28,7 @@ class UserTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
// create database connx :
$this->cn=new Database();
@@ -48,7 +48,7 @@ class UserTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
//drop user
$this->cn->exec_sql('delete from jnt_use_dos where use_id=$1',
diff --git a/unit-test/include/lib/databaseCore.Test.php
b/unit-test/include/lib/databaseCore.Test.php
index e8c5d44..370f29a 100644
--- a/unit-test/include/lib/databaseCore.Test.php
+++ b/unit-test/include/lib/databaseCore.Test.php
@@ -41,7 +41,7 @@ class DatabaseCoreTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
$noalyss_user = (defined("noalyss_user")) ? noalyss_user :
phpcompta_user;
$password = (defined("noalyss_password")) ? noalyss_password :
phpcompta_password;
@@ -54,7 +54,7 @@ class DatabaseCoreTest extends TestCase
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}
diff --git a/unit-test/include/lib/table_sql.Test.php
b/unit-test/include/lib/table_sql.Test.php
index f146c6c..88a86a9 100644
--- a/unit-test/include/lib/table_sql.Test.php
+++ b/unit-test/include/lib/table_sql.Test.php
@@ -39,7 +39,7 @@ class Noalyss_SQLTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp():void
{
global $g_connection;
$this->object=new Poste_analytique_SQL($g_connection);
@@ -66,7 +66,7 @@ VALUES(1, 'ACTIVITE', 'Activité commerciale Alchimerys sprl');
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- protected function tearDown()
+ protected function tearDown():void
{
}