fix DBUser: 帶入的變數名稱和實際流程的變數名稱沒對到 ->
This commit is contained in:
parent
2ad3627c88
commit
5d92668456
@ -51,7 +51,7 @@ class DBUser extends Database {
|
||||
|
||||
$query = $this->connDB->prepare($sqlString);
|
||||
$query->bindParam(":id", $uId);
|
||||
$query->bindParam(":passwd", $uPassword);
|
||||
$query->bindParam(":passwd", $password);
|
||||
$query->bindParam(":gid", $gId);
|
||||
$query->bindParam(":cid", $cId);
|
||||
$query->bindParam(":enable", $enable);
|
||||
@ -69,6 +69,26 @@ class DBUser extends Database {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查詢一位使用者帳號資料
|
||||
* @param string $uId 使用者名稱
|
||||
* @return array 使用者資料 (TODO 格式待補)
|
||||
*/
|
||||
public function queryUser($uId) {
|
||||
|
||||
$sqlString = "SELECT * FROM ".$db->table('User')." WHERE `UID` = :uid";
|
||||
|
||||
$query = $this->prepare($sqlString);
|
||||
$query->bindParam(':uid',$this->thisUID);
|
||||
$query->execute();
|
||||
|
||||
$result = $query->fetchAll();
|
||||
$this->infoArray = $result;
|
||||
return $this->infoArray;
|
||||
|
||||
// TODO unTested
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除一位使用者
|
||||
* @param string $uId 使用者名稱
|
||||
|
@ -41,7 +41,6 @@ class DBUserTest extends \PHPUnit_Framework_TestCase
|
||||
$this->db->insertUser($uId, $uPassword, $gId, $cId, $enable,
|
||||
$l_mode, $m_mode,
|
||||
$nickName, $realName, $email, $memo);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,9 +52,13 @@ class DBUserTest extends \PHPUnit_Framework_TestCase
|
||||
$this->db->deleteUser($uId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 測試時要填的資料
|
||||
*/
|
||||
public function userDataProvider(){
|
||||
return array(
|
||||
array('yuan', 'pass123', 'admin', null, true, 'harf-line-learn', 1, '元兒~', 'Yuan Chiu', 'chyuaner@gmail.com', null)
|
||||
array('yuan_unittest', 'pass123', 'admin', null, true, 'harf-line-learn', 1, '元兒~', 'Yuan Chiu', 'chyuaner@gmail.com', null),
|
||||
array('eee_unittest', 'qqqssss', 'admin', null, 1, 'harf-line-learn', '1', 'sss', 'Yuan Chiu', 'chyuanesr@gmail.com', null)
|
||||
);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user