* Add unit test of testcaseTao::getReviewAmount.
This commit is contained in:
@@ -516,6 +516,7 @@ class testcaseTao extends testcaseModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取待评审的用例数量。
|
||||
* Get the amount of cases pending review.
|
||||
*
|
||||
* @access protected
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/testcase.class.php';
|
||||
|
||||
zdTable('case')->gen(30);
|
||||
zdTable('user')->gen(1);
|
||||
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testcaseTao->getReviewAmount();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$testcase = new testcaseTest();
|
||||
|
||||
r($testcase->getReviewAmountTest()) && p() && e('7'); // 测试查询待评审的用例数量
|
||||
@@ -1784,4 +1784,20 @@ class testcaseTest
|
||||
$return = "id:{$scene->id}, parent:{$scene->parent}, path:{$scene->path}, grade:{$scene->grade}";
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试获取待评审的用例数量。
|
||||
* Test get the amount of cases pending review.
|
||||
*
|
||||
* @access public
|
||||
* @return int|array
|
||||
*/
|
||||
public function getReviewAmountTest(): int|array
|
||||
{
|
||||
$count = $this->objectModel->getReviewAmount();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user