noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 137/173: Fiche.Test : add test cmp_name and g


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 137/173: Fiche.Test : add test cmp_name and get_row
Date: Mon, 22 Mar 2021 12:59:12 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 9aa27a67e149409ce871e98341eba82bf5d8855f
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Sat Apr 4 14:59:24 2020 +0200

    Fiche.Test : add test cmp_name and get_row
---
 unit-test/include/class/fiche.Test.php | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/unit-test/include/class/fiche.Test.php 
b/unit-test/include/class/fiche.Test.php
index e3fe39c..08e2cf4 100644
--- a/unit-test/include/class/fiche.Test.php
+++ b/unit-test/include/class/fiche.Test.php
@@ -37,7 +37,10 @@ class FicheTest extends TestCase
      */
     public function testCmp_name()
     {
-       
+       include 'global.php';
+       $fiche=new \Fiche($g_connection,21);
+       $fiche_2=new \Fiche($g_connection,25);
+       $this->assertGreaterThan(\Fiche::cmp_name($fiche, $fiche_2),0);
     }
 
     /**
@@ -60,8 +63,25 @@ class FicheTest extends TestCase
      */
     public function testGet_row()
     {
-       $this->assertTrue(is_array($this->object->get_row(235,238)));
-       
+        include 'global.php';
+        $card_count=$g_connection->get_array("select count(*),f_id ". 
+        " from jrnx ".
+        " where ". 
+        " f_id is not null ".
+        "group by f_id order by count(*) desc");
+        $a=new Fiche($g_connection,$card_count[0]['f_id']);
+       try {
+            $a->get_row(235,238);
+            $this->assertFalse(TRUE,"Exception periode non executée");
+       } catch (\Exception $e) {
+           $this->assertTrue(TRUE);
+       }
+        $a_result= $a->get_row(92,131);
+        // Size == 25
+        
+        $nb_result=count($a_result);
+        $this->assertEquals ($nb_result,3,"Size array not correct ");
+        $this->assertEquals($a_result[0][24]["deb_montant"],204.71);
     }
 
 }



reply via email to

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