diff --git a/module/programplan/test/model/getparentchildrentypes.php b/module/programplan/test/model/getparentchildrentypes.php index 16a5c2bc7d..e22c632c31 100755 --- a/module/programplan/test/model/getparentchildrentypes.php +++ b/module/programplan/test/model/getparentchildrentypes.php @@ -17,25 +17,13 @@ title=测试 programplanModel->getParentChildrenTypes(); cid=1 pid=1 -查找父ID为 1 未删除的阶段类型 stage >> stage -查找父ID为 1 未删除的阶段类型 kanban >> kanban -查找父ID为 1 未删除的阶段类型数量 >> 2 -查找父ID为 2 未删除的阶段类型 sprint >> sprint -查找父ID为 2 未删除的阶段类型数量 >> 1 -查找父ID为 3 未删除的阶段类型 stage >> stage -查找父ID为 3 未删除的阶段类型 sprint >> sprint -查找父ID为 3 未删除的阶段类型数量 >> 2 -查找父ID为 1 未删除的阶段类型 stage >> 0 -查找父ID为 1 未删除的阶段类型 sprint >> 0 -查找父ID为 1 未删除的阶段类型 kanban >> 0 -查找父ID为 1 未删除的阶段类型数量 >> 0 - */ $parentIDList = array(1, 2, 3, 4); $programplan = new programplanTest(); +r($programplan->getParentChildrenTypesTest(0)) && p() && e('1'); // 查找父ID为 0 未删除的阶段类型 r($programplan->getParentChildrenTypesTest($parentIDList[0])) && p('stage') && e('stage'); // 查找父ID为 1 未删除的阶段类型 stage r($programplan->getParentChildrenTypesTest($parentIDList[0])) && p('kanban') && e('kanban'); // 查找父ID为 1 未删除的阶段类型 kanban r(count($programplan->getParentChildrenTypesTest($parentIDList[0]))) && p() && e('2'); // 查找父ID为 1 未删除的阶段类型数量 diff --git a/module/programplan/test/programplan.class.php b/module/programplan/test/programplan.class.php index 1e988a25cd..c04a8eebd2 100644 --- a/module/programplan/test/programplan.class.php +++ b/module/programplan/test/programplan.class.php @@ -342,17 +342,18 @@ class programplanTest } /** + * 测试获取父阶段的子类型。 * Test get parent stage's children types. * * @param int $parentID * @access public - * @return string + * @return array|bool */ - public function getParentChildrenTypesTest($parentID) + public function getParentChildrenTypesTest(int $parentID): array|bool { $objects = $this->objectModel->getParentChildrenTypes($parentID); - if(dao::isError()) return dao::getError(); + if(dao::isError()) return false; return $objects; }