Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 3 months ago

#27741 closed defect (bug) (duplicate)

Broken Tests_User_Query::test_prepare_query() in Multisite

Reported by: bpetty's profile bpetty Owned by:
Milestone: Priority: low
Severity: minor Version: 3.9
Component: Query Keywords: dev-feedback
Focuses: multisite Cc:


There was a fix for #21119 applied a couple months ago that added additional unit tests which do pass in single-site test runs, but fail under multisite (and have since the test was added two months ago):

1) Tests_User_Query::test_prepare_query
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
         0 => Array (...)
+        1 => Array (...)


I'm opening up a new ticket for this since a patch was already applied to the 3.9 branch, and given it's been in there for a couple months, it's likely just fine, and this can wait for a future release.

However, I would at least like the initial patch attached here applied immediately so this test is skipped for the 3.9 release for now, with this ticket being used for tracking it as a known issue beyond that. Feel free to punt this to Future Release when this is done.

Attachments (1)

ticket-27741-user-query-test.patch (472 bytes) - added by bpetty 10 years ago.

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
10 years ago

The arrays are nearly identical, except for meta_query, where the second one contains duplicate keys:

[meta_query] => Array(
	[0] => Array( [key] => wptests_capabilities )
	[1] => Array( [key] => wptests_capabilities )

#2 @nacin
10 years ago

  • Milestone changed from 3.9 to Future Release

It's pretty easy to see where in the code this fails. We have a $role || is_multisite() check in there as we use a role-based query to see what site users are a member of.

#3 @nacin
10 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

I was going to commit [ticket-27741-user-query-test.patch] (hence the move to Future) but I think this test failure is actually indicative of a problem in the original ticket. Closing as a duplicate of #21119.

Note: See TracTickets for help on using tickets.