* Add auto test.

This commit is contained in:
[denghongtao]
2022-03-14 09:22:53 +08:00
parent 5ac561a338
commit aac3861c31
61 changed files with 717 additions and 1868 deletions
+8 -25
View File
@@ -1,39 +1,22 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/program.class.php';
su('dev1');
/**
title=测试 programModel::getTopByID();
cid=1
pid=1
获取项目集1最上级的项目集id >> Not Found
*/
class Tester
{
public function __construct($user)
{
global $tester;
$t = new Program('admin');
su($user);
$this->program = $tester->loadModel('program');
}
$program_id = 1;
public function getById($programID = 0)
{
if(empty($this->program->getTopById($programID)))
{
return array('code' => 'fail', 'message' => 'Not Found');
}
else
{
return $this->program->getByTopId($programID);
}
}
}
$t = new Tester('admin');
/* GetTopById($programID). */
r($t->getByID(1)) && p('message') && e('Not Found'); // 获取项目集1最上级的项目集id
r($t->getByID3($program_id)) && p('message') && e('Not Found'); // 获取项目集1最上级的项目集id