Files
EasySoft-ZenTaoPMS/test/model/user/getdatainjson.php
2022-03-18 09:14:11 +08:00

30 lines
1.2 KiB
PHP
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->getDataInJSON();
cid=1
pid=1
传入admin用户信息返回公司信息 >> 易软天创网络科技有限公司
传入admin用户信息返回用户名信息 >> admin
传入null用户信息返回公司信息 >> 易软天创网络科技有限公司
*/
$user = new userTest();
$admin = new stdclass();
$admin->id = 1;
$admin->account = 'admin';
$admin->password = '123456';
$admin->deleted = '1';
r($user->getDataInJSONTest($admin)) && p('user:company') && e('易软天创网络科技有限公司'); //传入admin用户信息返回公司信息
r($user->getDataInJSONTest($admin)) && p('user:account') && e('admin'); //传入admin用户信息返回用户名信息
r($user->getDataInJSONTest($admin)) && p('user:password') && e(''); //传入admin用户信息返回密码信息
r($user->getDataInJSONTest(null)) && p('user:company') && e('易软天创网络科技有限公司'); //传入null用户信息返回公司信息