Example #1
0
 /**
  * Parse the given string as an range query.
  * 
  * @param string $string
  */
 public function __construct($string)
 {
     parent::__construct($string);
     $values = explode(Factory::syntax('symbols', 'delim', '|'), $string);
     foreach ($values as $value) {
         $this->values[] = OperatorQuery::make($value);
     }
 }
Example #2
0
 /**
  * Test if the defualt operator is equals, when no operator was supplied.
  * 
  * @return void
  */
 public function testOperatorIsDefaultEquals()
 {
     $query = OperatorQuery::make('value');
     $this->assertSame('=', $query->getOperator());
 }
Example #3
0
 /**
  * Test if the ->getRelation function returns the same as the RelationQuery object.
  * 
  * @return void
  */
 public function testGetOperatorReturnsOperatorQueryValue()
 {
     $query = '=valid';
     $this->assertEquals(OperatorQuery::make($query), (new Inquiry('key', $query))->getOperator());
 }
Example #4
0
 /**
  * Get the operator data from the query.
  * 
  * @return \Bycedric\Inquiry\Queries\OperatorQuery
  */
 public function getOperator()
 {
     return OperatorQuery::make($this->value);
 }