Skip to:
Content

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#2962 closed defect (fixed)

Use `get_sites()` for muiltisite PHPUnit testcase in `BBP_UnitTestCase::tearDown`

Reported by: netweb Owned by: netweb
Milestone: 2.6 Priority: normal
Severity: major Version:
Component: Tools - Unit Tests Keywords: needs-patch
Cc:

Description

WordPress 4.6 deprecated wp_get_sites(), switch to the replacement get_sites()

Via #WP36994 changeset:37653

Attachments (2)

2962.diff (676 bytes) - added by netweb 3 years ago.
2962.1.diff (2.3 KB) - added by netweb 3 years ago.

Download all attachments as: .zip

Change History (6)

@netweb
3 years ago

#1 @netweb
3 years ago

  • Owner set to netweb
  • Resolution set to fixed
  • Status changed from new to closed

In 6060:

Tools - Unit Tests: Use get_sites() for muiltisite PHPUnit testcase in BBP_UnitTestCase::tearDown

WordPress 4.6 deprecated wp_get_sites(), switch to the replacement get_sites() via #WP36994 / changeset:37653

Fixes #2962.

#2 @netweb
3 years ago

  • Keywords needs-patch added; has-patch removed
  • Resolution fixed deleted
  • Severity changed from normal to major
  • Status changed from closed to reopened

There's more to be done here.... Going to wait a few days for other tickets and commits to go in and revisit then

See also #WP37053 #WP36717

via https://wordpress.slack.com/archives/core-multisite/p1465451940000194

netweb [3:49 PM]: Much PHPUnit :boom:

netweb [3:56 PM]: Switched from wp_get_sites() to get_sites() results in Error: Cannot use object of type WP_Site as array

jeremyfelt [3:59 PM] That should be expected (need to write dev-notes). get_sites() is a replacement, but returns an array of WP_Site objects rather than the array of arrays.

jeremyfelt [3:59] So a replacement, but not a straight replacement

@netweb
3 years ago

#3 @netweb
3 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 6071:

Tests: Update forum/topic/reply post type assertions for the WP_Post_Type class introduced in WordPress 4.6

Fixes #2962.

#4 @netweb
3 years ago

In 6075:

Build Tools: More targeted cleanup for multisite unit tests.

This changeset is a subset of buddypress:changeset:9980 and removes a previous heavy-handed workaround for deleting the first multisite user. This also resolves a fatal error Object does not implement ArrayAccess when running the tests on HHVM.

See #2962, #2981

Note: See TracTickets for help on using tickets.