mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-17 18:29:55 +09:00
Updated unit tests - added input XML queries directly in the tests folder, instead of including them from core (for opage and syndication modules, which were removed).
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9786 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
3928e8ec37
commit
ad7dda9b75
19 changed files with 646 additions and 113 deletions
|
|
@ -1,44 +1,44 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Test class for Condition.
|
||||
* Test class for ConditionWithArgument.
|
||||
*/
|
||||
class ConditionTest extends CubridTest {
|
||||
class ConditionWithArgumentTest 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');
|
||||
|
||||
|
||||
$tag = new ConditionWithArgument('"member_srl"', $member_srl_argument, 'equal', null);
|
||||
|
||||
$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');
|
||||
|
||||
|
||||
$tag = new ConditionWithArgument('"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');
|
||||
|
||||
|
||||
$tag = new ConditionWithArgument('"member_srl"', $member_srl_argument, 'equal', 'and');
|
||||
|
||||
$this->assertEquals('', $tag->toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks "in" operation
|
||||
*/
|
||||
|
|
@ -46,11 +46,11 @@ class ConditionTest extends CubridTest {
|
|||
$member_srl_argument = new ConditionArgument('"member_srl"', array('a', 'b', 'c'), 'in');
|
||||
$member_srl_argument->createConditionValue();
|
||||
$member_srl_argument->setColumnType('varchar');
|
||||
|
||||
$tag = new Condition('"member_srl"', $member_srl_argument, 'in');
|
||||
|
||||
|
||||
$tag = new ConditionWithArgument('"member_srl"', $member_srl_argument, 'in');
|
||||
|
||||
$this->assertEquals(' "member_srl" in (\'a\',\'b\',\'c\')', $tag->toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue