* Autotest program.

This commit is contained in:
zhengrunyu
2022-01-18 10:41:40 +08:00
parent 8ebdc2a3b6
commit f7682bf7a2
13 changed files with 301 additions and 62 deletions

View File

@@ -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列表