Updated unit tests - added input XML queries directly in the tests folder, instead of including them from core (for opage and syndication modules, which were removed).

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9786 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-11-01 15:43:44 +00:00
parent 3928e8ec37
commit ad7dda9b75
19 changed files with 646 additions and 113 deletions

View file

@ -132,7 +132,7 @@
* in xe_modules. Maybe the developer ment "browser_title"
*/
function test_opage_getOpageList(){
$xml_file = _XE_PATH_ . "modules/opage/queries/getOpageList.xml";
$xml_file = _TEST_PATH_ . "db/xml_query/mssql/data/opage.getOpageList.xml";
$argsString = '$args->s_title = "yuhuu";
$args->module = \'opage\';';
$expected = 'SELECT TOP 20 *
@ -157,7 +157,7 @@
}
function test_syndication_getGrantedModule(){
$xml_file = _XE_PATH_ . "modules/syndication/queries/getGrantedModule.xml";
$xml_file = _TEST_PATH_ . "db/xml_query/mssql/data/syndication.getGrantedModule.xml";
$argsString = '$args->module_srl = 67;';
$expected = 'select count(*) as [count]
from [xe_module_grants] as [module_grants]

View file

@ -0,0 +1,24 @@
<query id="getOpageList" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="module" default="opage" />
<group pipe="and">
<condition operation="like" column="mid" var="s_mid" pipe="or" />
<condition operation="like" column="title" var="s_title" pipe="or" />
<condition operation="like" column="comment" var="s_comment" pipe="or" />
<condition operation="equal" column="module" var="s_module" pipe="or" />
<condition operation="equal" column="module_category_srl" var="s_module_category_srl" pipe="or" />
</group>
</conditions>
<navigation>
<index var="sort_index" default="module_srl" order="desc" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
</query>

View file

@ -0,0 +1,17 @@
<query id="getGrantedModule" action="select">
<tables>
<table name="module_grants" />
</tables>
<columns>
<column name="count(*)" alias="count" />
</columns>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" />
<condition operation="in" column="name" default="'access','view','list'" notnull="notnull" pipe="and" />
<group pipe="and">
<condition operation="more" column="group_srl" default="1" notnull="notnull" />
<condition operation="equal" column="group_srl" default="-1" notnull="notnull" pipe="or" />
<condition operation="equal" column="group_srl" default="-2" notnull="notnull" pipe="or" />
</group>
</conditions>
</query>