public function testCanBeJoinedWithAnotherTerm() { $oLeftTerm = new Sequin\Term('foo'); $oRightTerm = new Sequin\Term('bar'); $oLeftTerm->andRight($oRightTerm); $this->assertEquals('AND', $oLeftTerm->operator()); $this->assertSame($oRightTerm, $oLeftTerm->rightTerm()); $this->assertEquals('foo AND bar', $oLeftTerm->toString()); $oLeftTerm = new Sequin\Term('foo'); $oRightTerm = new Sequin\Term('bar'); $oLeftTerm->orRight($oRightTerm); $this->assertEquals('OR', $oLeftTerm->operator()); $this->assertSame($oRightTerm, $oLeftTerm->rightTerm()); $this->assertEquals('foo OR bar', $oLeftTerm->toString()); $oLeftTerm = new Sequin\Term('foo'); $oRightTerm = new Sequin\Term('bar'); $oLeftTerm->notRight($oRightTerm); $this->assertEquals('NOT', $oLeftTerm->operator()); $this->assertSame($oRightTerm, $oLeftTerm->rightTerm()); $this->assertEquals('foo NOT bar', $oLeftTerm->toString()); }