* Add project test and fix bug.

This commit is contained in:
孙广明
2022-04-06 16:01:06 +08:00
parent 598a6eb7e9
commit bd895ca244
31 changed files with 387 additions and 440 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
su('admin');
/**
title=测试 projectModel::getParentName();
cid=1
pid=1
获取id为11的项目父项目名字 >> 项目集1
获取id为1的项目父项目名字 >> 项目集1
获取id为0的项目父项目名字 >> 0
*/
global $tester;
$tester->loadModel('project');
$project1 = $tester->project->getById(11);
$project2 = $tester->project->getById(1);
r($tester->project->getParentProgram($project1)) && p('name') && e('项目集1'); // 获取id为11的项目父项目名字
r($tester->project->getParentProgram($project2)) && p('name') && e('0'); // 获取id为1的项目父项目名字