1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

More PDO tests.

This commit is contained in:
Cameron
2019-02-10 16:19:58 -08:00
parent c9981cda78
commit 17eff8de71

View File

@@ -65,15 +65,14 @@
public function testGetMode() public function testGetMode()
{ {
$actual = $this->db->getMode();
$this->assertEquals('NO_ENGINE_SUBSTITUTION', $actual);
} }
public function testDb_Connect() public function testDb_Connect()
{ {
$result = $this->db->db_Connect($this->dbConfig['mySQLserver'], $this->dbConfig['mySQLuser'], $this->dbConfig['mySQLpassword'], $this->dbConfig['mySQLdefaultdb']); $result = $this->db->db_Connect($this->dbConfig['mySQLserver'], $this->dbConfig['mySQLuser'], $this->dbConfig['mySQLpassword'], $this->dbConfig['mySQLdefaultdb']);
$this->assertTrue($result); $this->assertTrue($result);
} }
/** /**
@@ -240,14 +239,25 @@
{ {
} }
*/
public function testDb_Mark_Time() public function testDb_Mark_Time()
{ {
$this->db->debugMode(true);
$this->db->db_Mark_Time("Testing");
$actual = e107::getDebug()->getTimeMarkers();
$this->assertIsArray($actual);
$this->assertEquals('Testing', $actual[1]['What']);
$this->assertArrayHasKey('Index', $actual[1]);
$this->assertArrayHasKey('Time', $actual[1]);
$this->assertArrayHasKey('Memory', $actual[1]);
} }
*/
public function testDb_Write_log() public function testDb_Write_log()
{ {
$log_type = 127; $log_type = 127;
@@ -353,12 +363,25 @@
$actual = $this->db->retrieve('tmp', '*','tmp_ip = "127.0.0.1" AND tmp_time = 12345435'); $actual = $this->db->retrieve('tmp', '*','tmp_ip = "127.0.0.1" AND tmp_time = 12345435');
$this->assertEquals($expected, $actual, 'Inserted content doesn\'t match the retrieved content'); $this->assertEquals($expected, $actual, 'Inserted content doesn\'t match the retrieved content');
} }
/*
public function testLastInsertId() public function testLastInsertId()
{ {
$insert = array(
'gen_id' => 0,
'gen_type' => 'whatever',
'gen_datestamp' => time(),
'gen_user_id' => 1,
'gen_ip' => '127.0.0.1',
'gen_intdata' => '',
'gen_chardata' => ''
);
$this->db->insert('generic', $insert);
$actual = $this->db->lastInsertId();
$this->assertEquals(2,$actual);
} }
/*
public function testFoundRows() public function testFoundRows()
{ {