From 8b9468a165333e765f00155fabd189fbae4c8e56 Mon Sep 17 00:00:00 2001 From: ucorina Date: Wed, 20 Jul 2011 09:54:07 +0000 Subject: [PATCH] Update to default value - set it both when value is null or empty string. git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8613 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/xml/xmlquery/argument/Argument.class.php | 2 +- .../db/xml_query/cubrid/CubridInsertOnlineTest.php | 10 ++++++++++ test-phpUnit/db/xml_query/cubrid/CubridUpdateTest.php | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/classes/xml/xmlquery/argument/Argument.class.php b/classes/xml/xmlquery/argument/Argument.class.php index db37822ee..7a528f50c 100644 --- a/classes/xml/xmlquery/argument/Argument.class.php +++ b/classes/xml/xmlquery/argument/Argument.class.php @@ -77,7 +77,7 @@ } function ensureDefaultValue($default_value){ - if(!isset($this->value)) + if(!isset($this->value) || $this->value == '') $this->value = $default_value; } diff --git a/test-phpUnit/db/xml_query/cubrid/CubridInsertOnlineTest.php b/test-phpUnit/db/xml_query/cubrid/CubridInsertOnlineTest.php index 1515984fb..d96446205 100644 --- a/test-phpUnit/db/xml_query/cubrid/CubridInsertOnlineTest.php +++ b/test-phpUnit/db/xml_query/cubrid/CubridInsertOnlineTest.php @@ -63,6 +63,16 @@ } + function test_communication_addFriendGroup_NullId(){ + $args->member_srl = 202; + $args->title = "Grup"; + $args->friend_group_srl = trim(null); + + $output = executeQuery("communication.addFriendGroup", $args); + $this->assertEquals(0, $output->error, $output->message); + + } + protected function tearDown() { $db = &DB::getInstance(); $db->_query("DELETE FROM xe_modules WHERE module_srl = 47374"); diff --git a/test-phpUnit/db/xml_query/cubrid/CubridUpdateTest.php b/test-phpUnit/db/xml_query/cubrid/CubridUpdateTest.php index c3b4accf6..e731f0a45 100644 --- a/test-phpUnit/db/xml_query/cubrid/CubridUpdateTest.php +++ b/test-phpUnit/db/xml_query/cubrid/CubridUpdateTest.php @@ -27,7 +27,7 @@ , "open_rss" = \'Y\' , "header_text" = \'\' , "footer_text" = \'\' - , "use_mobile" = \'\' + , "use_mobile" = \'n\' WHERE "site_srl" = 0 AND "module_srl" = 47374'; $this->_test($xml_file, $argsString, $expected);