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

WordPress Trac noreply at wordpress.org
Tue Dec 22 20:30:06 UTC 2015


#35199: WP_UnitTest_Generator_Sequence is generating incorrect sequences
-------------------------------+------------------------------
 Reporter:  OddOneOut          |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Build/Test Tools   |     Version:  4.4
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by boonebgorges):

 * keywords:   => reporter-feedback


Comment:

 @OddOneOut Thanks for the ticket!

 The central purpose of `WP_UnitTest_Generator_Sequence` is to ensure
 uniqueness for things like slugs and user names. The static incrementor
 enforces uniqueness quite nicely, though you're correct that it increments
 quite aggressively.

 Are there practical problems that arise because of the current behavior? I
 assume you had previously written tests that assume that the incrementor
 in (say) the post_name will match the incrementor in the post_title? I am
 sympathetic to this. But at the same time, if you plan to make assertions
 about specific properties of a fixture, you probably ought to be
 specifying these properties when setting up the fixture.

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


More information about the wp-trac mailing list