* Autotest program.
This commit is contained in:
@@ -2,6 +2,24 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
|
||||
class Tester
|
||||
{
|
||||
public function __construct($user)
|
||||
{
|
||||
global $tester;
|
||||
|
||||
su('admin');
|
||||
$this->program = $tester->loadModel('program');
|
||||
}
|
||||
|
||||
public function getInvolvedPrograms($account)
|
||||
{
|
||||
return $this->program->getInvolvedPrograms($account);
|
||||
}
|
||||
}
|
||||
|
||||
$t = new Tester('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 programModel::getInvolvedPrograms();
|
||||
@@ -9,6 +27,5 @@ cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$program = $tester->loadModel('program');
|
||||
r($program->getInvolvedPrograms('admin')) && p() && e(''); // 通过id字段获取存在的项目集
|
||||
r($t->getInvolvedPrograms('admin')) && p('122') && e('122'); // 查看用户admin可以看到的项目和执行id列表
|
||||
r($t->getInvolvedPrograms('test2')) && p('1;122') && e('1;122'); // 查看用户test2可以看到的项目和执行id列表
|
||||
|
||||
Reference in New Issue
Block a user