Merge branch dev/task-147555 of zentao/zentaopms (#10866)
This commit is contained in:
@@ -114,30 +114,6 @@ class todoTest
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试删除待办.
|
||||
* Test delete a todo.
|
||||
*
|
||||
* @param int $todoID
|
||||
* @param string $confirm yes|no
|
||||
* @access public
|
||||
* @return object|false
|
||||
*/
|
||||
public function deleteTest(int $todoID, string $confirm = 'no'): object|false
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
return $this->objectModel->getById($todoID);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->objectModel->delete(TABLE_TODO, $todoID);
|
||||
if(dao::isError()) return false;
|
||||
|
||||
return $this->objectModel->getById($todoID);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试完成待办.
|
||||
* Test finish a todo.
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/todo.unittest.class.php';
|
||||
su('admin');
|
||||
|
||||
function initData()
|
||||
{
|
||||
zenData('todo')->loadYaml('delete')->gen(10);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
title=测试删除todo todoModel->delete();
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
*/
|
||||
|
||||
initData();
|
||||
|
||||
$todo = new todoTest();
|
||||
r($todo->deleteTest(8, 'no')) && p('id,deleted') && e('8,0'); // 删除指定id的待办,取消确认
|
||||
$todo->deleteTest(8, 'yes');
|
||||
r($todo->getByIdTest(8)) && p('deleted') && e('1'); // 验证删除id不存在的todo信息
|
||||
Reference in New Issue
Block a user