+ userTest: add method to test the checkBeforeBatchCreate method.

This commit is contained in:
liugang
2023-12-14 09:22:24 +08:00
parent 3eaa59f20b
commit b5aea30f9f
+22
View File
@@ -415,6 +415,28 @@ class userTest
return array('result' => (int)$result, 'errors' => $errors);
}
/**
* 测试批量创建用户前检查提交的数据。
* Test check posted data before batch creating users.
*
* @param array $users
* @param string $verifyPassword
* @access public
* @return array
*/
public function checkBeforeBatchCreateTest(array $users, string $verifyPassword): array
{
$result = $this->objectModel->checkBeforeBatchCreate($users, $verifyPassword);
$errors = dao::getError();
foreach($errors as $key => $error)
{
if(is_array($error)) $errors[$key] = implode('', $error);
}
return array('result' => (int)$result, 'errors' => $errors);
}
/**
* 测试检查提交的用户密码。
* Test check posted user password.