[buddypress-trac] [BuddyPress Trac] #6009: Share fixtures across unit tests where appropriate

buddypress-trac noreply at wordpress.org
Fri Nov 14 14:01:19 UTC 2014


#6009: Share fixtures across unit tests where appropriate
--------------------------+------------------
 Reporter:  boonebgorges  |       Owner:
     Type:  task          |      Status:  new
 Priority:  normal        |   Milestone:  2.2
Component:  Unit Tests    |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------

Comment (by boonebgorges):

 In [changeset:"9139"]:
 {{{
 #!CommitTicketReference repository="" revision="9139"
 In automated tests, move user creation to a proper factory method.

 BP user creation requires that a couple of extra pieces of data be set up
 (last activity, display name, etc). So we previously had a wrapper in
 `BP_UnitTestCase` called `create_user()` that performed the extra setup.
 However, the wrapper made it impossible to use `create_user()` statically,
 because the user_login and user_email iterator was not persistent from
 call to
 call. (The `create_user()` syntax is also a break with the rest of our
 unit
 tests, which is not ideal.)

 This changeset introduces `BP_UnitTest_Factory_For_User`, which reproduces
 the
 customizations of `create_user()`, but in a proper factory method. All
 instances of `create_user()` throughout the test suite have also been
 replaced.

 See #6009.
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6009#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list