[buddypress-trac] [BuddyPress Trac] #7709: Unit Tests: Speed up multisite specific test

buddypress-trac noreply at wordpress.org
Sun Mar 4 19:47:20 UTC 2018


#7709: Unit Tests: Speed up multisite specific test
------------------------------+-----------------------
 Reporter:  r-a-y             |      Owner:  netweb
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  3.0
Component:  Build/Test Tools  |    Version:  2.2
 Severity:  normal            |   Keywords:  has-patch
------------------------------+-----------------------
 One of our multisite unit tests was slowing things down considerably -
 `test_bp_core_get_directory_pages_multisite_delete_post_with_same_bp_page_id()`.

 I introduced this in #6226.  Basically, the test would create new posts in
 a loop(!) until it reached a certain page ID on a sub-site.

 There is a much more efficient way of doing this by using a not-well-
 documented parameter in `wp_insert_post()` called `'import_id'`.  Setting
 `'import_id'` will just use the post ID we want to use.

 Going to commit.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7709>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list