#3108 closed defect (bug) (fixed)
Fix tests after [6414]
Reported by: | thebrandonallen | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 2.6 | Priority: | normal |
Severity: | normal | Version: | trunk |
Component: | Tools - Unit Tests | Keywords: | has-patch commit |
Cc: |
Description
After [6414] test broke. Fixing the phpunit
: trim() expects parameter 1 to be string, array given
errors revealed some other surprises.
The performance improvements were drastic enough that tests were failing because of post date collisions. In the places where we create_many()
post dates were equal. In most cases this was fine. In places where we're trying to get the last id, this resulted in the wrong id being returned. The queries were being ordered by descending post date, then ascending post id.
Attached patch fixes the trim errors, two assertEquals
on arrays, and the post date collisions by setting our last id functions to sort by post date, then by post id, in descending order.
Also included, but not required are changes to test_bbp_get_forum_last_reply_id()
which should allow for that test to run a little faster. We were querying for the last reply id when we already knew what to expect.
These all look good to me. 👍
Thanks!