Files
EasySoft-ZenTaoPMS/module/action/test/model/getlikeobject.php
2025-11-14 13:05:25 +08:00

43 lines
1.6 KiB
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env php
<?php
/**
title=测试 actionModel::getLikeObject();
timeout=0
cid=14902
- 执行action模块的getLikeObjectTest方法参数是TABLE_PROJECT, 'name', 'name', '%项目集%' @5
- 执行action模块的getLikeObjectTest方法参数是TABLE_PROJECT, 'code', 'code', '%program%' @5
- 执行action模块的getLikeObjectTest方法参数是TABLE_PROJECT, 'name', 'name', '%不存在%' @0
- 执行action模块的getLikeObjectTest方法参数是TABLE_BUG, 'title', 'title', '%测试%' @3
- 执行action模块的getLikeObjectTest方法参数是TABLE_PROJECT, 'name', 'name', '%\'OR\'1\'=\'1%' @0
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/action.unittest.class.php';
$project = zenData('project');
$project->id->range('1-5');
$project->name->range('项目集1,项目集2,项目集3,项目集4,项目集5');
$project->code->range('program1,program2,program3,program4,program5');
$project->type->range('program{5}');
$project->gen(5);
$bug = zenData('bug');
$bug->id->range('1-3');
$bug->title->range('测试Bug1,测试Bug2,测试Bug3');
$bug->gen(3);
zenData('actionrecent')->gen(0);
su('admin');
$action = new actionTest();
r($action->getLikeObjectTest(TABLE_PROJECT, 'name', 'name', '%项目集%')) && p() && e('5');
r($action->getLikeObjectTest(TABLE_PROJECT, 'code', 'code', '%program%')) && p() && e('5');
r($action->getLikeObjectTest(TABLE_PROJECT, 'name', 'name', '%不存在%')) && p() && e('0');
r($action->getLikeObjectTest(TABLE_BUG, 'title', 'title', '%测试%')) && p() && e('3');
r($action->getLikeObjectTest(TABLE_PROJECT, 'name', 'name', '%\'OR\'1\'=\'1%')) && p() && e('0');