PHPUnit's assertEquals() vs assertSame()

PHPUnit has always had theassertEquals() and assertSame() functions for comparing results. These functions perform assertions similar to PHP's == and === respectively.

Generally, we try and use === in new code as much as possible. However, when trying to use the similar assertSame() in PHPUnit failures would not show the nice diffs that assertEquals() did.

Well, good news! I was writing some tests on the latest version of PHP unit and notice that assertSame() now shows diffs for arrays. I recommend trying to use assertSame() yourself now instead of assertEquals() in as many rests as possible.