* Adjust unit test check rule for build getStoryBuilds.
This commit is contained in:
@@ -243,7 +243,8 @@ class buildModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get story builds.
|
||||
* 根据需求ID获取版本列表。
|
||||
* Get builds by story ID.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
@@ -252,6 +253,7 @@ class buildModel extends model
|
||||
public function getStoryBuilds(int $storyID): array
|
||||
{
|
||||
if(empty($storyID)) return array();
|
||||
|
||||
return $this->dao->select('*')->from(TABLE_BUILD)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere("CONCAT(',', stories, ',')")->like("%,$storyID,%")
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
|
||||
title=测试 buildModel->getStoryBuilds();
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/build.class.php';
|
||||
su('admin');
|
||||
@@ -11,19 +19,8 @@ $build->createdBy->range('admin');
|
||||
$build->createdDate->range('`' . date('Y-m-d H:i:s') . '`');
|
||||
$build->gen(20);
|
||||
|
||||
/**
|
||||
|
||||
title=测试 buildModel->getStoryBuilds();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
项目版本查询 >> 项目版本版本7
|
||||
执行版本查询 >> 执行版本版本17
|
||||
无id查询 >> 0
|
||||
图片字段传字符串测试 >> 17
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$build = $tester->loadModel('build');
|
||||
r(count($build->getStoryBuilds(1))) && p() && e('2'); //项目版本查询
|
||||
r(count($build->getStoryBuilds(1))) && p() && e('2'); // 查询需求ID为1的版本列表
|
||||
r(count($build->getStoryBuilds(0))) && p() && e('0'); // 查询需求ID为空的版本列表
|
||||
r(count($build->getStoryBuilds(11))) && p() && e('0'); // 查询需求ID为11的版本列表
|
||||
|
||||
Reference in New Issue
Block a user