mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
Fix for max()
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user