* [unittest] modify unittest.
This commit is contained in:
Regular → Executable
+7
@@ -4,11 +4,14 @@
|
||||
/**
|
||||
|
||||
title=测试 userModel->checkBeforeCreateOrEdit();
|
||||
timeout=0
|
||||
cid=0
|
||||
|
||||
- 使用系统预留用户名返回 false。属性result @0
|
||||
- 使用系统预留用户名提示信息。第errors条的account属性 @用户名已被系统预留
|
||||
- 使用正常用户名返回 true。属性result @1
|
||||
- 执行$user3属性account @user1
|
||||
- 执行$user3属性verifyPassword @8e2803f8b0a6fcbb9501f3799795c736
|
||||
|
||||
*/
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
@@ -22,6 +25,7 @@ $random = updateSessionRandom();
|
||||
|
||||
$user1 = (object)array('account' => 'guest', 'verifyPassword' => '');
|
||||
$user2 = (object)array('account' => 'admin', 'verifyPassword' => md5(md5('123456') . $random));
|
||||
$user3 = (object)array('account' => 'user1', 'verifyPassword' => md5(md5('Asd@123') . 'test'));
|
||||
|
||||
$userTest = new userTest();
|
||||
|
||||
@@ -30,3 +34,6 @@ r($result1) && p('result') && e(0); // 使用系统
|
||||
r($result1) && p('errors:account') && e('用户名已被系统预留'); // 使用系统预留用户名提示信息。
|
||||
|
||||
r($userTest->checkBeforeCreateOrEditTest($user2, true)) && p('result') && e(1); // 使用正常用户名返回 true。
|
||||
|
||||
r($user3) && p('account') && e('user1'); // 查看$user3属性account @user1
|
||||
r($user3) && p('verifyPassword') && e('8e2803f8b0a6fcbb9501f3799795c736'); // 查看$user3属性verifyPassword @8e2803f8b0a6fcbb9501f3799795c736
|
||||
Reference in New Issue
Block a user