* Add bugModel-createBuild and its unit test, and add comment.

This commit is contained in:
liumengyi
2023-05-17 09:23:48 +08:00
parent f5119224a3
commit 5e02ba5df3
6 changed files with 190 additions and 29 deletions
+31
View File
@@ -2219,4 +2219,35 @@ class bugTest
return 'no error';
}
}
/**
* 测试在解决bug的时候创建版本。
* Test create build when resolving a bug.
*
* @access public
* @return array
*/
public function createBuildTest(object $bug, int $bugID)
{
global $tester;
$oldBug = $tester->dao->findByID($bugID)->from(TABLE_BUG)->fetch();
$this->objectModel->createBuild($bug, $oldBug);
if(dao::isError())
{
$errors = dao::getError();
$return = '';
foreach($errors as $key => $value)
{
if(is_string($value)) $return .= "{$value}";
if(is_array($value)) $return .= implode('', $value);
}
return $return;
}
else
{
$build = $tester->dao->findByID($bug->resolvedBuild)->from(TABLE_BUILD)->fetch();
return $build;
}
}
}