1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-28 08:12:42 +01:00

Use existing instance of database object.

This commit is contained in:
Cameron 2019-02-03 11:04:44 -08:00
parent 1ec80dc28c
commit c9c6caba7f

View File

@ -245,7 +245,7 @@
*/
public function testInsert()
{
$actual = e107::getDb()->insert('tmp', array('tmp_ip' => '127.0.0.1', 'tmp_time' => time(), 'tmp_info' => 'test insert'));
$actual = $this->db->insert('tmp', array('tmp_ip' => '127.0.0.1', 'tmp_time' => time(), 'tmp_info' => 'test insert'));
$this->assertEquals(1, $actual, 'Unable to add record to table #tmp');
}
/*
@ -281,7 +281,7 @@
*/
public function testUpdate()
{
$db = e107::getDb();
$db = $this->db;
$db->delete('tmp');
@ -353,9 +353,10 @@
*/
public function testDelete()
{
$expected = e107::getDB()->count('tmp');
$actual = e107::getDb()->delete('tmp');
$expected = $this->db->count('tmp');
$actual = $this->db->delete('tmp');
$this->assertEquals($expected, $actual, 'Unable to delete all records.');
}
/*
public function testDb_Delete()