1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 11:50:30 +02: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() 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'); $this->assertEquals(1, $actual, 'Unable to add record to table #tmp');
} }
/* /*
@@ -281,7 +281,7 @@
*/ */
public function testUpdate() public function testUpdate()
{ {
$db = e107::getDb(); $db = $this->db;
$db->delete('tmp'); $db->delete('tmp');
@@ -353,9 +353,10 @@
*/ */
public function testDelete() public function testDelete()
{ {
$expected = e107::getDB()->count('tmp'); $expected = $this->db->count('tmp');
$actual = e107::getDb()->delete('tmp'); $actual = $this->db->delete('tmp');
$this->assertEquals($expected, $actual, 'Unable to delete all records.'); $this->assertEquals($expected, $actual, 'Unable to delete all records.');
} }
/* /*
public function testDb_Delete() public function testDb_Delete()