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

WordPress Trac noreply at wordpress.org
Tue Jan 5 16:11:46 UTC 2016


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

Comment (by wonderboymusic):

 if we're setting up fixtures statically, there's almost no way ensure
 uniqueness across tests without having the static counter in
 `WP_UnitTest_Generator_Sequence`. `WP_UnitTest_Generator_Sequence` should
 be completely agnostic to when it is called and where. Things like post
 titles and slugs should also remain dynamic in tests. So, instead of
 asserting against magic numbers and strings, you can assert against a
 string that is built with `$post1->post_title`, etc.

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


More information about the wp-trac mailing list