[wp-trac] [WordPress Trac] #35199: WP_UnitTest_Generator_Sequence is generating incorrect sequences

WordPress Trac noreply at wordpress.org
Fri Apr 22 14:35:56 UTC 2016


#35199: WP_UnitTest_Generator_Sequence is generating incorrect sequences
------------------------------+---------------------------
 Reporter:  OddOneOut         |       Owner:  boonebgorges
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  4.6
Component:  Build/Test Tools  |     Version:  4.4
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:
------------------------------+---------------------------
Changes (by boonebgorges):

 * owner:   => boonebgorges
 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"37299"]:
 {{{
 #!CommitTicketReference repository="" revision="37299"
 Tests: Use the same incrementor for all fields belonging to a given text
 fixture.

 [35244] changed the way that `WP_UnitTest_Generator_Sequence()` created an
 incrementor for object fields (like 'post_name' and 'user_email'), by
 making
 incrementor static across the entire run of the test suite. While this
 helped
 to enforce uniqueness across the tests, it has the side effect of bumping
 the
 incrementor between fields on the same object (so that, eg, the same post
 might
 have `post_name` "post-12" but `post_title` "Post 13". By switching to a
 technique that uses the same incrementor for each field belonging to a
 given
 fixture, we conform better to the expectations of developers using
 `WP_UnitTest_Factory`.

 Fixes #35199.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35199#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list