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.

CommentFileSizeAuthor
#2 3025685-2.patch1016 bytesquietone

Comments

quietone created an issue. See original summary.

quietone’s picture

StatusFileSize
new1016 bytes

And the patch.

quietone’s picture

Status: Active » Needs review

NR for testing

mikelutz’s picture

Status: Needs review » Reviewed & tested by the community

Looks like this is a useful test update. RTBC!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 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.

  • alexpott committed 9b485b8 on 8.7.x
    Issue #3025685 by quietone: Add error msg to assertions in...

  • alexpott committed bdb2125 on 8.6.x
    Issue #3025685 by quietone: Add error msg to assertions in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.