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->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 subject:(val2 OR val3) OR (subject:product3 - subject:product4)"', $this->query->convertToSearchString()); }
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()); }