Files
EasySoft-ZenTaoPMS/test/model/user/getgroups.php
2022-03-17 13:40:02 +08:00

22 lines
662 B
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
su('admin');
/**
title=测试 userModel::getGroupsTest();
cid=1
pid=1
获取admin所在的分组,为空 >> 0
通过test2所在的分组数量1个 >> 1
传空用户名,返回空 >> 0
*/
$user = new userTest();
r($user->getGroupsTest('admin')) && p() && e('0'); // 获取admin所在的分组,为空
r(count($user->getGroupsTest('test2'))) && p() && e('1'); // 通过test2所在的分组数量1个
r($user->getGroupsTest('')) && p() && e('0'); // 传空用户名,返回空