* Add cases of user.

This commit is contained in:
孙广明
2021-10-19 15:46:57 +08:00
parent 7155161701
commit 6cbf8074f2
5 changed files with 53 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
#!use/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
/**
title=删除用户;
cid=1
pid=1
删除用户 >> message:success
*/
global $token;
$result = $rest->delete('/users/10', array('token' => $token->token));
r($result) && c(200) && p() && e("message:success") ; //删除ID为10的用户,判断返回信息
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
/**
title=测试获取根据ID获取用户真实姓名;
cid=1
pid=1
编辑ID为3的用户,获取真实姓名 >> 李铁柱
*/
global $token;
$user = $rest->put('/users/3', array('realname' => '李铁柱'), array('token' => $token->token));
r($user) && c(200) && p('realname') && e('李铁柱'); // 编辑ID为3的用户,获取真实姓名
Executable → Regular
View File
+18
View File
@@ -0,0 +1,18 @@
#!use/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
/**
title=测试获取用户列表;
cid=1
pid=1
获取用户列表,判断ID为1和2的真实姓名 >> admin,测试1
*/
global $token;
$list = $rest->get('/users?page=1&limit=2&order=id_asc', array('token' => $token->token));
r($list->body->users) && p('realname') && e('admin,测试1'); //获取用户列表,判断ID为1和2的真实姓名
Executable → Regular
-1
View File
@@ -16,7 +16,6 @@ $insert = array(
'account' => 'sgm',
'password' => 'qaz19950422',
'realname' => '孙广明',
'gender' => 'm',
'email' => 'sgm0422@163.com',
);
$user = $rest->post('/users', $insert, array('token' => $token->token));