1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Don't assume an empty table in e_db_abstractTest::testIsEmpty()

This commit is contained in:
Nick Liu 2021-03-30 20:11:59 -05:00
parent 99aa39a8e5
commit c68604b971
No known key found for this signature in database
GPG Key ID: 1167C5F9C9897637

View File

@ -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);