mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
Started unit tests for condition and argument classes.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8577 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7112d518c8
commit
76019a4b2b
15 changed files with 537 additions and 108 deletions
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test class for Condition.
|
||||
*/
|
||||
class ConditionTest extends CubridTest {
|
||||
|
||||
/**
|
||||
* Checks equal operation
|
||||
*/
|
||||
public function testConditionString_Equal_WithoutPipe_NumericValue() {
|
||||
$member_srl_argument = new ConditionArgument('"member_srl"', 20, 'equal');
|
||||
|
||||
$tag = new Condition('"member_srl"', $member_srl_argument, 'equal');
|
||||
|
||||
$this->assertEquals(' "member_srl" = 20', $tag->toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks equal operation
|
||||
*/
|
||||
public function testConditionString_Equal_WithPipe_NumericValue() {
|
||||
$member_srl_argument = new ConditionArgument('"member_srl"', 20, 'equal');
|
||||
|
||||
$tag = new Condition('"member_srl"', $member_srl_argument, 'equal', 'and');
|
||||
|
||||
$this->assertEquals('and "member_srl" = 20', $tag->toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks condition returns nothing when argument is not valid
|
||||
*/
|
||||
public function testConditionString_InvalidArgument() {
|
||||
$member_srl_argument = new ConditionArgument('"member_srl"', null, 'equal');
|
||||
$member_srl_argument->checkNotNull();
|
||||
|
||||
$tag = new Condition('"member_srl"', $member_srl_argument, 'equal', 'and');
|
||||
|
||||
$this->assertEquals('', $tag->toString());
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue