[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 04/04: PHPUNIT test bug #0002061: Fiche ne pe
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 04/04: PHPUNIT test bug #0002061: Fiche ne peuvent pas devenir inactive |
Date: |
Thu, 2 Sep 2021 18:27:30 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit ffb5cd715d87ca2a06dd59adf6958b58adcdaca2
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Fri Sep 3 00:27:11 2021 +0200
PHPUNIT test bug #0002061: Fiche ne peuvent pas devenir inactive
---
unit-test/include/class/fiche.Test.php | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/unit-test/include/class/fiche.Test.php
b/unit-test/include/class/fiche.Test.php
index 3c14f1b..7ebcaa7 100644
--- a/unit-test/include/class/fiche.Test.php
+++ b/unit-test/include/class/fiche.Test.php
@@ -674,4 +674,25 @@ where
}
}
+ /**
+ * @testdox testUpdateEnable card enable and disable
+ */
+ public function testUpdateEnable()
+ {
+ global $g_connection;
+ $fiche= $fiche=$this->build_fiche(2,'PHPUNIT-ENABLE');
+ $fiche->update($fiche->to_array());
+ $this->assertEquals(1,$g_connection->get_value("select f_enable from
fiche where f_id=$1",[$fiche->id])," Fiche::update card is not enabled" );
+ $fiche->set_f_enable(0);
+ $fiche->update($fiche->to_array());
+ $this->assertEquals(0,$g_connection->get_value("select f_enable from
fiche where f_id=$1",[$fiche->id])," Fiche::update card is not disabled" );
+ $fiche->set_f_enable(1);
+ Card_Property::update($fiche);
+ $this->assertEquals(1,$g_connection->get_value("select f_enable from
fiche where f_id=$1",[$fiche->id]),"Card_Property:update card is not enabled" );
+ $fiche->set_f_enable(0);
+ Card_Property::update($fiche);
+ $this->assertEquals(0,$g_connection->get_value("select f_enable from
fiche where f_id=$1",[$fiche->id]),"Card_Property:update card is not disabled"
);
+ $fiche->remove();
+
+ }
}