Problem/Motivation
It is too often too difficult to find out which array key has the error in a source plugin test. The expected arrays are very similar (for example, lots of keys with a value of 0 or 1), and the error messages, do not indicate in which array the error is occurring. Sure using the debugger or commenting out arrays will work but it would be a lot simpler if the test reported the array index.
Proposed resolution
Add a informative message to two assertions where this is most needed when looping through all the plugin rows.
Lately I have been using this and it had proven helpful.
sprintf("Value at 'array[%s][%s]' is not correct.", $i - 1, $key);
Remaining tasks
The usual.
Decide on the wording of the error message.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3025685-2.patch | 1016 bytes | quietone |
Comments
Comment #2
quietone commentedAnd the patch.
Comment #3
quietone commentedNR for testing
Comment #4
mikelutzLooks like this is a useful test update. RTBC!
Comment #5
alexpottCommitted 9b485b8 and pushed to 8.7.x. Thanks!
Committed bdb2125f11 and pushed to 8.6.x. Thanks!
Backported to 8.6.x as the is a test improvement.