mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Issue 499: query xml > operation 에 and, or, xor 추가 건의
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9799 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c34090b7fb
commit
9ffb1b39a0
2 changed files with 53 additions and 1 deletions
|
|
@ -66,6 +66,10 @@
|
|||
case 'notlike' :
|
||||
case 'in' :
|
||||
case 'notin' :
|
||||
case 'and':
|
||||
case 'or':
|
||||
case 'xor':
|
||||
case 'not':
|
||||
case 'notequal' :
|
||||
// if variable is not set or is not string or number, return
|
||||
if(!isset($this->_value)) { $this->_show = false; break;}
|
||||
|
|
@ -126,7 +130,19 @@
|
|||
case 'null' :
|
||||
return $name.' is null';
|
||||
break;
|
||||
case 'between' :
|
||||
case 'and' :
|
||||
return $name.' & '.$value;
|
||||
break;
|
||||
case 'or' :
|
||||
return $name.' | '.$value;
|
||||
break;
|
||||
case 'xor' :
|
||||
return $name.' ^ '.$value;
|
||||
break;
|
||||
case 'not' :
|
||||
return $name.' ~ '.$value;
|
||||
break;
|
||||
case 'between' :
|
||||
return $name.' between ' . $value[0] . ' and ' . $value[1];
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,42 @@ class ConditionWithArgumentTest extends CubridTest {
|
|||
|
||||
$this->assertEquals(' "member_srl" in (\'a\',\'b\',\'c\')', $tag->toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks and operation
|
||||
*/
|
||||
public function testConditionString_And() {
|
||||
$tag = new ConditionWithoutArgument('"member_srl"', "20", 'and', null);
|
||||
|
||||
$this->assertEquals(' "member_srl" & 20', $tag->toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks or operation
|
||||
*/
|
||||
public function testConditionString_Or() {
|
||||
$tag = new ConditionWithoutArgument('"member_srl"', "20", 'or', null);
|
||||
|
||||
$this->assertEquals(' "member_srl" | 20', $tag->toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks xor operation
|
||||
*/
|
||||
public function testConditionString_Xor() {
|
||||
$tag = new ConditionWithoutArgument('"member_srl"', "20", 'xor', null);
|
||||
|
||||
$this->assertEquals(' "member_srl" ^ 20', $tag->toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks not operation
|
||||
*/
|
||||
public function testConditionString_Not() {
|
||||
$tag = new ConditionWithoutArgument('"member_srl"', "20", 'not', null);
|
||||
|
||||
$this->assertEquals(' "member_srl" ~ 20', $tag->toString());
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue