equivalentTo() public method

public equivalentTo ( Webmozart\Expression\Expression $other )
$other Webmozart\Expression\Expression
コード例 #1
0
 public function testEquivalentTo()
 {
     $disjunction1 = new OrX(array(new Key('name', new Same('10')), new Key('age', new GreaterThan(0))));
     // disjunctions match independent of the order of the conjuncts
     $disjunction2 = new OrX(array(new Key('age', new GreaterThan(0)), new Key('name', new Same('10'))));
     $disjunction3 = new OrX(array(new Key('age', new GreaterThan(0))));
     $this->assertTrue($disjunction1->equivalentTo($disjunction2));
     $this->assertTrue($disjunction2->equivalentTo($disjunction1));
     $this->assertFalse($disjunction2->equivalentTo($disjunction3));
     $this->assertFalse($disjunction3->equivalentTo($disjunction2));
     $this->assertFalse($disjunction1->equivalentTo($disjunction3));
     $this->assertFalse($disjunction3->equivalentTo($disjunction1));
 }