Merge branch 'sprint/hufangzhou_programplanUnitCase' into 'master'

* Add the programplan unit testcase.

See merge request easycorp/zentaopms!7068
This commit is contained in:
孙广明
2023-02-27 00:33:51 +00:00
7 changed files with 282 additions and 5 deletions
+86
View File
@@ -385,4 +385,90 @@ class programplanTest
return $objects;
}
/**
* Test check if the stage is a leaf stage.
*
* @param int $planID
* @access public
* @return string
*/
public function checkLeafStageTest($planID)
{
$objects = $this->objectModel->checkLeafStage($planID);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test check whether it is the top stage.
*
* @param int $planID
* @access public
* @return string
*/
public function checkTopStageTest($planID)
{
$objects = $this->objectModel->checkTopStage($planID);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test update sub-stage attribute.
*
* @param int $planID
* @param string $attribute
* @param int $subStageID
* @access public
* @return string
*/
public function updateSubStageAttrTest($planID, $attribute, $subStageID)
{
global $tester;
$objects = $this->objectModel->updateSubStageAttr($planID, $attribute);
if(dao::isError()) return dao::getError();
$attribute = $tester->dao->select('attribute')->from(TABLE_EXECUTION)->where('id')->eq($subStageID)->fetch('attribute');
return $attribute;
}
/**
* Test get plan and its children.
*
* @param string|int|array $executionIdList
* @access public
* @return string
*/
public function getSelfAndChildrenListTest($executionIdList)
{
$objects = $this->objectModel->getSelfAndChildrenList($executionIdList);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get plan's siblings.
*
* @param string|int|array $executionIdList
* @access public
* @return string
*/
public function getSiblingsTest($executionIdList)
{
$objects = $this->objectModel->getSiblings($executionIdList);
if(dao::isError()) return dao::getError();
return $objects;
}
}