Issue 62: xml Query Supported Not Like

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9621 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-10-12 18:54:31 +00:00
parent abae1ca3b0
commit 84e7cb3e2f
7 changed files with 161 additions and 0 deletions

View file

@ -143,4 +143,52 @@
and (`group_srl` >= 1 or `group_srl` = -1 or `group_srl` = -2) group by `module_srl`';
$this->_test($xml_file, $argsString, $expected);
}
function test_Like_Clause(){
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/opage.getOpageList.like.xml";
$argsString = '$args->s_mid = "test";';
$expected = 'select *
from `xe_modules` as `modules`
where `module` = \'opage\'
and (`mid` like \'%test%\')
order by `module_srl` desc
limit 0, 20';
$this->_test($xml_file, $argsString, $expected);
}
function test_NotLike_Clause(){
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/opage.getOpageList.notlike.xml";
$argsString = '$args->s_mid = "test";';
$expected = 'select *
from `xe_modules` as `modules`
where `module` = \'opage\'
and (`mid` not like \'%test%\')
order by `module_srl` desc
limit 0, 20';
$this->_test($xml_file, $argsString, $expected);
}
function test_NotLikeTail_Clause(){
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/opage.getOpageList.notliketail.xml";
$argsString = '$args->s_mid = "test";';
$expected = 'select *
from `xe_modules` as `modules`
where `module` = \'opage\'
and (`mid` not like \'%test\')
order by `module_srl` desc
limit 0, 20';
$this->_test($xml_file, $argsString, $expected);
}
function test_NotLikePrefix_Clause(){
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/opage.getOpageList.notlikeprefix.xml";
$argsString = '$args->s_mid = "test";';
$expected = 'select *
from `xe_modules` as `modules`
where `module` = \'opage\'
and (`mid` not like \'test%\')
order by `module_srl` desc
limit 0, 20';
$this->_test($xml_file, $argsString, $expected);
}
}