[buddypress-trac] [BuddyPress Trac] #6009: Share fixtures across unit tests where appropriate
buddypress-trac
noreply at wordpress.org
Fri Nov 14 13:50:13 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):
There are some complications to making `setUpBeforeClass()` work in our
suite. This method (and `tearDownAfterClass()` must be called statically.
This means that they must also call all testcase and factory methods
statically. So the relevant methods will have to be defined as static.
This in itself is not too big a deal, but `create_user()` in particular
causes problems, because when static, a new factory will have to be
defined for each call; and when that happens, the
`WP_UnitTest_Generator_Sequence` objects are not persistent.
For this reason, `create_user()` should be removed, and we should move
that logic into our own `BP_UnitTest_Factory_For_User` which will extend
the WP version to do our specific BP work. This has the added benefit of
greater consistency in our tests.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6009#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list