mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-23 04:12:18 +09:00
Fixed select bug - unless default value is explicitly set as empty string, ignore arguments whose value is empty string.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8624 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
8f04aa5d63
commit
7de48344cc
7 changed files with 47 additions and 21 deletions
|
|
@ -16,6 +16,19 @@ class ConditionArgumentTest extends CubridTest {
|
|||
$condition = new Condition('"extra_vars"."document_srl"',$document_srl_argument,"in", 'and');
|
||||
$this->assertEquals('and "extra_vars"."document_srl" in (1234)', $condition->toString());
|
||||
}
|
||||
|
||||
function testZeroValue(){
|
||||
$args->site_srl = 0;
|
||||
$site_srl_argument = new ConditionArgument('site_srl', $args->site_srl, 'equal');
|
||||
$site_srl_argument->checkNotNull();
|
||||
$site_srl_argument->createConditionValue();
|
||||
if(!$site_srl_argument->isValid()) return $site_srl_argument->getErrorMessage();
|
||||
$site_srl_argument->setColumnType('number');
|
||||
|
||||
$condition = new Condition('"sites"."site_srl"',$site_srl_argument,"equal");
|
||||
$this->assertEquals(' "sites"."site_srl" = 0', $condition->toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo Implement testCreateConditionValue().
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@
|
|||
|
||||
$this->assertNotEquals(-225, $output->error);
|
||||
$this->assertNotEquals('Missing value for attribute "homepage" with the NOT NULL constraint.', $output->message);
|
||||
|
||||
|
||||
}
|
||||
|
||||
function test_communication_addFriendGroup(){
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
$this->assertEquals($output->data->module_srl, 111);
|
||||
}
|
||||
|
||||
function test_module_getInfo(){
|
||||
function test_module_getInfo(){
|
||||
$args->site_srl = 0;
|
||||
$output = executeQuery('module.getSiteInfo', $args);
|
||||
$this->assertTrue(is_a($output, 'Object'));
|
||||
|
|
@ -46,5 +46,17 @@
|
|||
|
||||
$this->assertTrue(is_int($output->page), $output->message);
|
||||
}
|
||||
|
||||
function test_member_getMemberList(){
|
||||
$args->is_admin = '';
|
||||
$args->is_denied = '';
|
||||
$args->sort_index = "list_order";
|
||||
$args->sort_order = 'asc';
|
||||
$args->list_count = 40;
|
||||
$args->page_count = 10;
|
||||
|
||||
$output = executeQuery('member.getMemberList', $args);
|
||||
$this->assertEquals(0, $output->error, $output->message);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -194,9 +194,21 @@
|
|||
, "xe_documents" as "documents"
|
||||
WHERE "documents"."document_srl" = 10
|
||||
and "modules"."module_srl" = "documents"."module_srl"';
|
||||
$this->_test($xml_file, $argsString, $expected);
|
||||
|
||||
|
||||
$this->_test($xml_file, $argsString, $expected);
|
||||
}
|
||||
|
||||
function test_member_getMemberList(){
|
||||
$xml_file = _XE_PATH_ . "modules/member/queries/getMemberList.xml";
|
||||
$argsString = '$args->is_admin = \'\';
|
||||
$args->is_denied = \'\';
|
||||
$args->sort_index = "list_order";
|
||||
$args->sort_order = \'asc\';
|
||||
$args->list_count = 40;
|
||||
$args->page_count = 10;';
|
||||
$expected = 'select * from "xe_member" as "member"
|
||||
order by "list_order" asc
|
||||
limit 0, 40';
|
||||
$this->_test($xml_file, $argsString, $expected);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue