From 26ca49ab3b6c6d269056b4eafbbff6ec7fa8df4e Mon Sep 17 00:00:00 2001 From: liugang Date: Fri, 15 Dec 2023 09:09:59 +0800 Subject: [PATCH] + userTest: add method to test the checkBeforeBatchUpdate method. --- module/user/test/user.class.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/module/user/test/user.class.php b/module/user/test/user.class.php index a331d2e2e8..6b9f034272 100755 --- a/module/user/test/user.class.php +++ b/module/user/test/user.class.php @@ -437,6 +437,28 @@ class userTest return array('result' => (int)$result, 'errors' => $errors); } + /** + * 测试批量编辑用户前检查提交的数据。 + * Test check posted data before batch editing users. + * + * @param array $users + * @param string $verifyPassword + * @access public + * @return array + */ + public function checkBeforeBatchUpdateTest(array $users, string $verifyPassword): array + { + $result = $this->objectModel->checkBeforeBatchUpdate($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.