Exemplo n.º 1
0
 /**
  * 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 ConditionWithArgument('"member_srl"', $member_srl_argument, 'equal', 'and');
     $this->assertEquals('', $tag->toString());
 }
Exemplo n.º 2
0
 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 ConditionWithArgument('"sites"."site_srl"', $site_srl_argument, "equal");
     $this->assertEquals(' "sites"."site_srl" = 0', $condition->toString());
 }
Exemplo n.º 3
0
 /**
  * Checks that argument becomes invalid after a notnull check when value is null
  */
 public function testCheckNotNullWhenNull()
 {
     $member_srl_argument = new ConditionArgument('member_srl', null, 'equal');
     $member_srl_argument->checkNotNull();
     $this->assertEquals(false, $member_srl_argument->isValid());
 }