* [unittest] fix getbyid file error.
This commit is contained in:
@@ -22,7 +22,6 @@ cid=1
|
||||
- 属性type @project
|
||||
- 属性model @kanban
|
||||
- 获取不存在的项目 @0
|
||||
- 获取字符串ID的项目属性code @($projectID) must be of type int
|
||||
|
||||
*/
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
@@ -31,9 +30,9 @@ include dirname(__FILE__, 2) . '/lib/project.unittest.class.php';
|
||||
zenData('project')->loadYaml('project')->gen(3)->fixPath();
|
||||
su('admin');
|
||||
|
||||
$projectTester = new Project();
|
||||
r($projectTester->getByIDTest(1)) && p('id,name,type,model') && e('1,敏捷项目1,project,scrum'); // 获取ID为1的项目数据
|
||||
r($projectTester->getByIDTest(2)) && p('id,name,type,model') && e('2,瀑布项目2,project,waterfall'); // 获取ID为2的项目数据
|
||||
r($projectTester->getByIDTest(3)) && p('id,name,type,model') && e('3,看板项目3,project,kanban'); // 获取ID为3的项目数据
|
||||
r($projectTester->getByIDTest(100)) && p() && e('0'); // 获取不存在的项目
|
||||
r($projectTester->getByIDTest('aaa')) && p('code') && e('($projectID) must be of type int'); // 获取字符串ID的项目
|
||||
global $tester;
|
||||
$projectModel = $tester->loadModel('project');
|
||||
r($projectModel->getByID(1)) && p('id,name,type,model') && e('1,敏捷项目1,project,scrum'); // 获取ID为1的项目数据
|
||||
r($projectModel->getByID(2)) && p('id,name,type,model') && e('2,瀑布项目2,project,waterfall'); // 获取ID为2的项目数据
|
||||
r($projectModel->getByID(3)) && p('id,name,type,model') && e('3,看板项目3,project,kanban'); // 获取ID为3的项目数据
|
||||
r($projectModel->getByID(100)) && p() && e('0'); // 获取不存在的项目
|
||||
|
||||
Reference in New Issue
Block a user