WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #53119, comment 10


Ignore:
Timestamp:
04/30/2021 09:19:53 PM (3 months ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #53119, comment 10

    initial v1  
    44> In my ''opinion'', test ''helper'' functions should always be at the bottom of a test class (or in an abstract test case). What do you think ?
    55
    6 I think I would apply the same logic as for data providers here. If the helper function is only used in one or two tests, e.g. an `add_filter()` callback, I would expect to see it directly after the test.
     6I think I would apply the same logic as for data providers here. If the helper function is only used in one or two tests, e.g. an `add_filter()` callback, I would expect to see it directly after the test to keep the context.
    77
    88If the helper is used for multiple tests that do not necessarily belong together as a group, then I would expect to find the helper function after the `::setUp()`/`::tearDown()` methods, or at the bottom.