1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-14 02:24:08 +02:00

Test isolation fixes for e_db_abstractTest

Also needed a null check in e_db_pdo::db_Query()
This commit is contained in:
Nick Liu
2020-01-17 20:23:13 +01:00
parent a0f4489e41
commit 91660a2c32
2 changed files with 11 additions and 0 deletions

View File

@@ -109,6 +109,9 @@ abstract class e_db_abstractTest extends \Codeception\Test\Unit
public function testDb_Mark_Time()
{
$this->db->debugMode(true);
e107::getDebug()->aTimeMarks = [];
e107::getDebug()->nTimeMarks = 0;
e107::getDebug()->e107_db_debug();
$this->db->db_Mark_Time("Testing");
@@ -121,8 +124,12 @@ abstract class e_db_abstractTest extends \Codeception\Test\Unit
$this->assertArrayHasKey('Memory', $actual[1]);
$this->db->debugMode(false);
e107::getDebug()->aTimeMarks = [];
e107::getDebug()->nTimeMarks = 0;
e107::getDebug()->e107_db_debug();
$result = $this->db->db_Mark_Time("Testing");
$this->assertNull($result);
$this->assertEquals(1, count(e107::getDebug()->getTimeMarkers()));
}
@@ -138,6 +145,9 @@ abstract class e_db_abstractTest extends \Codeception\Test\Unit
public function testDb_IsLang()
{
// XXX: This test leads to e_pref, which depends on lan_admin.php
e107::coreLan('', true);
$result = $this->db->db_IsLang('news', false);
$this->assertEquals('news', $result);