public function testEquivalentTo() { $conjunction1 = new AndX(array(new Key('name', new Same('10')), new Key('age', new GreaterThan(0)))); // conjunctions match independent of the order of the conjuncts $conjunction2 = new AndX(array(new Key('age', new GreaterThan(0)), new Key('name', new Same('10')))); $conjunction3 = new AndX(array(new Key('age', new GreaterThan(0)))); $this->assertTrue($conjunction1->equivalentTo($conjunction2)); $this->assertTrue($conjunction2->equivalentTo($conjunction1)); $this->assertFalse($conjunction2->equivalentTo($conjunction3)); $this->assertFalse($conjunction3->equivalentTo($conjunction2)); $this->assertFalse($conjunction1->equivalentTo($conjunction3)); $this->assertFalse($conjunction3->equivalentTo($conjunction1)); }