public function testComplexQuery() { $simpleSubQuery = $this->createSearchQuery(); $simpleSubQuery->value('val1'); $complexSubQuery = $this->createSearchQuery(); $complexSubQuery->value('val2'); $complexSubQuery->orOperator(); $complexSubQuery->value('val3'); $this->query->item('subject', $simpleSubQuery); $this->query->andOperator(); $this->query->item('subject', $complexSubQuery); $this->query->orOperator(); $this->query->openParenthesis(); $this->query->item('subject', 'product3'); $this->query->notOperator(); $this->query->item('subject', 'product4'); $this->query->closeParenthesis(); $this->assertEquals('SUBJECT val1 OR (OR SUBJECT val2 SUBJECT val3) (SUBJECT product3 NOT SUBJECT product4)', $this->query->convertToSearchString()); }
public function testAndOperator() { $this->query->andOperator(); $this->assertEquals('""', $this->query->convertToSearchString()); }