* Add unit test of testcaseTao::getReviewAmount.

This commit is contained in:
liumengyi
2023-09-21 16:39:17 +08:00
parent fcd24e2464
commit 422cadab13
3 changed files with 38 additions and 0 deletions
+1
View File
@@ -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'); // 测试查询待评审的用例数量
+16
View File
@@ -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;
}
}