mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +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:
@@ -439,6 +439,7 @@ class e_db_pdo implements e_db
|
|||||||
|
|
||||||
if(is_array($query))
|
if(is_array($query))
|
||||||
{
|
{
|
||||||
|
$query['BIND'] = isset($query['BIND']) ? $query['BIND'] : null;
|
||||||
$query = "PREPARE: " . $query['PREPARE'] . "<br />BIND:" . print_a($query['BIND'], true); // ,true);
|
$query = "PREPARE: " . $query['PREPARE'] . "<br />BIND:" . print_a($query['BIND'], true); // ,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -109,6 +109,9 @@ abstract class e_db_abstractTest extends \Codeception\Test\Unit
|
|||||||
public function testDb_Mark_Time()
|
public function testDb_Mark_Time()
|
||||||
{
|
{
|
||||||
$this->db->debugMode(true);
|
$this->db->debugMode(true);
|
||||||
|
e107::getDebug()->aTimeMarks = [];
|
||||||
|
e107::getDebug()->nTimeMarks = 0;
|
||||||
|
e107::getDebug()->e107_db_debug();
|
||||||
|
|
||||||
$this->db->db_Mark_Time("Testing");
|
$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->assertArrayHasKey('Memory', $actual[1]);
|
||||||
|
|
||||||
$this->db->debugMode(false);
|
$this->db->debugMode(false);
|
||||||
|
e107::getDebug()->aTimeMarks = [];
|
||||||
|
e107::getDebug()->nTimeMarks = 0;
|
||||||
|
e107::getDebug()->e107_db_debug();
|
||||||
$result = $this->db->db_Mark_Time("Testing");
|
$result = $this->db->db_Mark_Time("Testing");
|
||||||
$this->assertNull($result);
|
$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()
|
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);
|
$result = $this->db->db_IsLang('news', false);
|
||||||
$this->assertEquals('news', $result);
|
$this->assertEquals('news', $result);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user