* [unittest] Add the unit test file of executionModel::delete.

This commit is contained in:
xieqiyu
2025-06-12 16:30:35 +08:00
parent 6d23c56445
commit 820e761462
2 changed files with 43 additions and 0 deletions
@@ -3097,4 +3097,19 @@ class executionTest
$return = $this->executionModel->getToAndCcList($execution);
return $return;
}
/**
* 删除一个执行。
* Delete an execution.
*
* @param string $table
* @param int $executionID
* @access public
* @return void
*/
public function deleteTest(int $executionID = 0)
{
$this->executionModel->delete(TABLE_EXECUTION, $executionID);
return $this->executionModel->dao->select('deleted')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch('deleted');
}
}
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/execution.unittest.class.php';
zenData('user')->gen(5);
su('admin');
/**
title=测试executionModel->activateTest();
cid=0
- 测试删除迭代5 @1
- 测试删除迭代6 @1
- 测试删除迭代7 @1
- 测试删除迭代8 @1
- 测试删除迭代9 @1
*/
zenData('project')->loadYaml('execution')->gen(10);
$execution = new executionTest();
r($execution->deleteTest(101)) && p() && e('1'); //测试删除迭代5
r($execution->deleteTest(102)) && p() && e('1'); //测试删除迭代6
r($execution->deleteTest(103)) && p() && e('1'); //测试删除迭代7
r($execution->deleteTest(104)) && p() && e('1'); //测试删除迭代8
r($execution->deleteTest(105)) && p() && e('1'); //测试删除迭代9