[wp-trac] [WordPress Trac] #53010: Tests: introduce namespacing for the test classes

WordPress Trac noreply at wordpress.org
Wed Sep 18 19:27:53 UTC 2024


#53010: Tests: introduce namespacing for the test classes
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:
                                                 |  hellofromTonya
     Type:  task (blessed)                       |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Build/Test Tools                     |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  2nd-opinion has-patch has-unit-      |     Focuses:  docs,
  tests                                          |  coding-standards
-------------------------------------------------+-------------------------

Comment (by hellofromTonya):

 Replying to [comment:34 jrf]:
 > Related: #62004
 >
 > Note: while yes/no namespacing is still up for debate, the rest of the
 proposals in this ticket MUST be addressed to allow the test suite to
 update to PHPUnit 11/12, so this ticket is no longer just a suggestion. It
 is a requirement.

 This ticket is now part of #62004. The renaming and splitting tasks are
 now a requirement and prerequisite:

 - [ ] Split the tests into 1 test class per each function or method.
 [https://core.trac.wordpress.org/ticket/62004#Problem4:coversattributesareonlysupportedatclasslevelx2
 See the explanation here].
 - [ ] Rename the test class to remove `Tests_` prefix and add `_Test`
 suffix.
 [https://core.trac.wordpress.org/ticket/62004#Problem5:noneofthetestclassescomplywithPHPUnitnamingconventions
 See the explanation here].
 - [ ] Rename each test class file to exactly match the class name.
 [https://core.trac.wordpress.org/ticket/62004#Problem5:noneofthetestclassescomplywithPHPUnitnamingconventions
 See the explanation here].

 As all of the test classes will need to be touched/changed/split, what is
 proposed in this ticket now aligns well with these needs as @jrf explains:
 >As all test classes will need to be touched/changed/split to address
 problem 4 anyway, I would strongly recommend for the new test classes to
 be made fully compatible with the PHPUnit naming conventions.
 >
 >This will prevent having to re-do this exercise yet again in the future
 if the bypass for the first rule would be made impossible.

 The PRs already attached to this ticket are good examples of these tasks.

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


More information about the wp-trac mailing list