Skip to content

Commit

Permalink
Merge pull request propelorm#854 from stevleibelt/master
Browse files Browse the repository at this point in the history
Fixed bug introduced by fix [0] and discussed [1].
  • Loading branch information
willdurand committed Mar 31, 2014
2 parents 10180f9 + 475e666 commit e914de6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runtime/lib/query/Join.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,14 @@ public function getClause(&$params)
*/
public function equals($join)
{
$parametersOfThisClauses = array();
$parametersOfJoinClauses = array();

return $join !== null
&& $join instanceof Join
&& $this->getJoinType() == $join->getJoinType()
&& $this->getConditions() == $join->getConditions();
&& $this->getConditions() == $join->getConditions()
&& $this->getClause($parametersOfThisClauses) == $join->getClause($parametersOfJoinClauses);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions test/testsuite/runtime/query/JoinTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ public function testEquality()
$j7 = new Join('foo', 'bar', 'INNER JOIN');
$this->assertTrue($j5->equals($j7), 'Join without specified join type should be equal
to INNER JOIN, as it fallback to default join type');

$j8 = new Join('foo', 'bar', 'INNER JOIN');
$j8->addCondition('baz.foo', 'baz.bar');
$this->assertFalse($j5->equals($j8));
}

public function testCountConditions()
Expand Down

0 comments on commit e914de6

Please sign in to comment.