From c4cbb19749d73b5e1e388c71d3f3fa281cae48c8 Mon Sep 17 00:00:00 2001 From: Deltik Date: Wed, 13 Feb 2019 21:31:28 -0600 Subject: [PATCH] Improved determinism of cloned testDb_Select_gen() tests If either e_db_mysqlTest's or e_db_pdoTest's testDb_Select_gen() method gets called before the other, the second won't update and will return 0 instead of the expected 1. The UPDATE query is unique for each test now so that this cannot happen anymore. --- tests/unit/e_db_mysqlTest.php | 4 +++- tests/unit/e_db_pdoTest.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/unit/e_db_mysqlTest.php b/tests/unit/e_db_mysqlTest.php index f3c6ffcba..37d6116b8 100644 --- a/tests/unit/e_db_mysqlTest.php +++ b/tests/unit/e_db_mysqlTest.php @@ -303,7 +303,9 @@ public function testDb_Select_gen() { - $result = $this->db->db_Select_gen("UPDATE `#user` SET user_ip = '127.0.0.3' WHERE user_id = 1"); + $result = $this->db->db_Select_gen( + "UPDATE `#user` SET user_signature = 'e_db_mysql' WHERE user_id = 1" + ); $this->assertEquals(1,$result); } diff --git a/tests/unit/e_db_pdoTest.php b/tests/unit/e_db_pdoTest.php index 783d9ad7e..3dd2943fc 100644 --- a/tests/unit/e_db_pdoTest.php +++ b/tests/unit/e_db_pdoTest.php @@ -330,7 +330,9 @@ public function testDb_Select_gen() { - $result = $this->db->db_Select_gen("UPDATE `#user` SET user_ip = '127.0.0.3' WHERE user_id = 1"); + $result = $this->db->db_Select_gen( + "UPDATE `#user` SET user_signature = 'e_db_pdo' WHERE user_id = 1" + ); $this->assertEquals(1,$result); }