Skip to content

Commit

Permalink
Compare identical closures as being the same
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaranmcnulty committed Dec 21, 2019
1 parent d2d4a30 commit 6bfa26f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/Prophecy/Comparator/ClosureComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ public function accepts($expected, $actual)

public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = array())
{
throw new ComparisonFailure(
$expected,
$actual,
// we don't need a diff
'',
'',
false,
'all closures are born different'
);
if ($expected !== $actual) {
throw new ComparisonFailure(
$expected,
$actual,
// we don't need a diff
'',
'',
false,
'all closures are different if not identical'
);
}
}
}

0 comments on commit 6bfa26f

Please sign in to comment.