Exemple #1
0
 /**
  * Test if the ->hasOperator function returns boolean.
  * 
  * @return void
  */
 public function testHasOperatorReturnsOperatorQueryValue()
 {
     $valid = '=valid';
     $invalid = '#invalid';
     $this->assertEquals(OperatorQuery::validate($valid), (new Inquiry('key', $valid))->hasOperator());
     $this->assertEquals(OperatorQuery::validate($invalid), (new Inquiry('key', $invalid))->hasOperator());
 }
 /**
  * Test if no operator is still valid.
  * 
  * @return void
  */
 public function testNoOperatorIsValid()
 {
     $this->assertTrue(OperatorQuery::validate('valid'));
 }
Exemple #3
0
 /**
  * Check if the query contains an operator statement.
  * 
  * @return bool
  */
 public function hasOperator()
 {
     return OperatorQuery::validate($this->value);
 }