From c68604b971587738c5171e3015aee1fd8453f067 Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Tue, 30 Mar 2021 20:11:59 -0500 Subject: [PATCH] Don't assume an empty table in e_db_abstractTest::testIsEmpty() --- e107_tests/tests/unit/e_db_abstractTest.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/e107_tests/tests/unit/e_db_abstractTest.php b/e107_tests/tests/unit/e_db_abstractTest.php index 0f2251448..35c8dffb7 100644 --- a/e107_tests/tests/unit/e_db_abstractTest.php +++ b/e107_tests/tests/unit/e_db_abstractTest.php @@ -851,11 +851,17 @@ abstract class e_db_abstractTest extends \Codeception\Test\Unit public function testIsEmpty() { - $result = $this->db->isEmpty('plugin'); + $this->db->copyTable('user', 'test_is_empty', true, true); + + $result = $this->db->isEmpty('test_is_empty'); $this->assertFalse($result); - // $result = $this->db->isEmpty('comments'); - // $this->assertTrue($result); + $this->db->truncate('test_is_empty'); + + $result = $this->db->isEmpty('test_is_empty'); + $this->assertTrue($result); + + $this->db->dropTable('test_is_empty'); $result = $this->db->isEmpty(); $this->assertFalse($result);