-
Sub-task
-
Resolution: Won't Fix
-
Minor
-
None
-
2.3.3
-
MOODLE_23_STABLE
I'm just looking at some failing unit tests, and the failures they report are the wrong way round. The message output is :
Failed asserting that -1 matches expected null.
When actually, it is -1 that was expected.
PHPUnit assertions function generally take the expected value, then the actual value in that order. I don't know how widespread this is, and I'm not sure that it's worth the bother of fixing existing tests en masse, but it might be worth keeping an eye on it for future tests, to save people time when debugging failures.
The file I'm seeing this in is lib/ddl/test/ddl_tests.php and it has maybe a hundred or so examples of this, though it's not consistent so some of the assertEquals are the right way round.
- is duplicated by
-
MDL-37208 Unit Test assertEquals parameters reversed
-
- Closed
-