mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 11:44:10 +09:00
Add some unit tests for DBQueryParser (more to come)
This commit is contained in:
parent
8bb01edf86
commit
10302ea44e
4 changed files with 186 additions and 0 deletions
21
tests/_data/dbquery/selectJoinTest1.xml
Normal file
21
tests/_data/dbquery/selectJoinTest1.xml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<query id="selectJoinTest1" action="select">
|
||||
<tables>
|
||||
<table name="documents" />
|
||||
<table name="member" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="member.member_srl" />
|
||||
<column name="COUNT(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="documents.member_srl" var="member.member_srl" />
|
||||
<condition operation="equal" column="documents.member_srl" default="member.member_srl" />
|
||||
<condition operation="in" column="documents.document_srl" var="document_srl_list" pipe="and" />
|
||||
</conditions>
|
||||
<groups>
|
||||
<group column="member.member_srl" />
|
||||
<having>
|
||||
<condition operation="notequal" column="member.member_srl" var="exclude_member_srl" notnull="notnull" />
|
||||
</having>
|
||||
</groups>
|
||||
</query>
|
||||
17
tests/_data/dbquery/selectJoinTest2.xml
Normal file
17
tests/_data/dbquery/selectJoinTest2.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<query id="selectJoinTest2" action="select">
|
||||
<tables>
|
||||
<table name="documents" />
|
||||
<table name="member" type="left join">
|
||||
<conditions>
|
||||
<condition operation="equal" column="documents.member_srl" default="member.member_srl" />
|
||||
</conditions>
|
||||
</table>
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="documents.*" />
|
||||
<column name="member.regdate" alias="member_regdate" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="documents.document_srl" var="document_srl_list" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
21
tests/_data/dbquery/selectTest.xml
Normal file
21
tests/_data/dbquery/selectTest.xml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<query id="selectTest" action="select">
|
||||
<tables>
|
||||
<table name="documents" />
|
||||
</tables>
|
||||
<columns distinct="true">
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="member_srl" var="member_srl" filter="number" notnull="notnull" />
|
||||
<group pipe="and">
|
||||
<condition operation="gte" column="regdate" var="regdate_more" notnull="notnull" />
|
||||
<condition operation="equal" column="status" var="status_list" default="PUBLIC" pipe="or" />
|
||||
</group>
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="list_order" order="order_type" />
|
||||
<list_count var="list_count" default="20" />
|
||||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
</navigation>
|
||||
</query>
|
||||
Loading…
Add table
Add a link
Reference in a new issue