From 759cf6f190dca35c6be7f6c2a3246cb8135ea2af Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 11 Feb 2019 12:20:30 -0800 Subject: [PATCH] More test for legacy fetch --- tests/unit/e_db_pdoTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/unit/e_db_pdoTest.php b/tests/unit/e_db_pdoTest.php index 92447d89d..d5e16fd29 100644 --- a/tests/unit/e_db_pdoTest.php +++ b/tests/unit/e_db_pdoTest.php @@ -593,7 +593,21 @@ $this->assertEquals("e107", $row['user_name']); $this->assertEquals("e107", $row[1]); + // legacy tests + $this->db->select('user', '*', 'user_id = 1'); + $row = $this->db->db_Fetch(MYSQL_ASSOC); + $this->assertArrayHasKey('user_ip', $row); + $qry = 'SHOW CREATE TABLE `'.MPREFIX."user`"; + $this->db->gen($qry); + + $row = $this->db->db_Fetch(MYSQL_NUM); + $this->assertEquals('e107_user', $row[0]); + + $this->db->select('user', '*', 'user_id = 1'); + $row = $this->db->db_Fetch(MYSQL_BOTH); + $this->assertEquals("e107", $row['user_name']); + $this->assertEquals("e107", $row[1]); } @@ -794,6 +808,9 @@ $result = $this->db->isEmpty('comments'); $this->assertTrue($result); + $result = $this->db->isEmpty(); + $this->assertFalse($result); + } public function testDb_ResetTableList()