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

Fix for max()

This commit is contained in:
Cameron
2019-02-13 16:07:43 -08:00
parent 505fabb09d
commit 56051cf0cc

View File

@@ -76,6 +76,12 @@
{ {
$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);
$result = $this->db->db_Connect($this->dbConfig['mySQLserver'], $this->dbConfig['mySQLuser'], "wrong password", $this->dbConfig['mySQLdefaultdb']);
$this->assertEquals('e1', $result);
$result = $this->db->db_Connect($this->dbConfig['mySQLserver'], $this->dbConfig['mySQLuser'], $this->dbConfig['mySQLpassword'], "wrong database");
$this->assertEquals('e2', $result);
} }
public function testGetServerInfo() public function testGetServerInfo()
@@ -616,12 +622,13 @@
{ {
} }
*/
public function testDb_Close() public function testDb_Close()
{ {
$this->db->db_Close();
} }
*/
public function testDelete() public function testDelete()
{ {
// make sure the table is empty // make sure the table is empty
@@ -702,9 +709,22 @@
public function testMax() public function testMax()
{ {
$result = $this->db->max('user', 'user_pwchange'); $insert = array(
$this->assertEquals('1541074253', $result); 'gen_id' => 0,
'gen_type' => 'testMax',
'gen_datestamp' => time(),
'gen_user_id' => 555,
'gen_ip' => '127.0.0.1',
'gen_intdata' => '',
'gen_chardata' => ''
);
$this->db->insert('generic', $insert);
$result = $this->db->max('generic', 'gen_user_id');
$this->assertEquals('555', $result);
// var_dump($result);
} }