Closed romaninsh closed 7 years ago
Both eq()
and same()
, as well as their negative counterparts notEq()
and notSame()
all have the the same structure of 'actual' vs 'expected'.
I'm unsure what value there would be in amending the message when things are consistent within this library.
In addition, with lazy assertions, the first value can be passed through several assertions, making the first value the 'actual'.
Although I think that having "expected" as a first argument is more sensible, I respect your choice and the importance to be consistent with lazy assertions.
I really enjoying your library, great replacement for PHPUnit, but there is one incompatibility.
phpunit: eq(expected, actual).
assert: eq(actual, expected).
It's more common for methods to have "defining" arguments first. Consider this example:
eq(10, $var);
can also be written as
eq10($var);
This is why I think this swap should be made, (not because phpunit)
To fix arguments here should be swapped: https://github.com/beberlei/assert/blob/master/lib/Assert/Assertion.php#L305
I can create PR for this.