[wp-trac] [WordPress Trac] #53119: Tests: introduce naming conventions for data providers and use named test cases

WordPress Trac noreply at wordpress.org
Fri Apr 30 21:09:58 UTC 2021


#53119: Tests: introduce naming conventions for data providers and use named test
cases
------------------------------+------------------------------
 Reporter:  jrf               |       Owner:  (none)
     Type:  task (blessed)    |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:                    |     Focuses:  docs
------------------------------+------------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:1 pbiron]:
 > I would, however, recommend one change to the proposal: put all data
 providers at the bottom of the class, regardless of which tests they are
 used for.
 >
 > I think that simplification/consistency would be easier for contributors
 to "grasp".

 I see the point, but I have to agree with @hellofromTonya here.
 Personally, I find it much easier to grasp if the data provider directly
 follows the test it's used in, as proposed here. If the provider is used
 for multiple tests, it's still easier for me to see them grouped together
 and find the data provider after the last test in the group.

 If there are multiple data providers in a class, having them all at the
 bottom of the class without a predictable order and having to jump back
 and forth while trying to keep the context would seem confusing to me.

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


More information about the wp-trac mailing list