[wp-trac] [WordPress Trac] #19278: Allow WP_List_Table ::get_bulk_items() to receive a nested array and output optgroups

WordPress Trac noreply at wordpress.org
Tue Nov 24 20:35:19 UTC 2020


#19278: Allow WP_List_Table ::get_bulk_items() to receive a nested array and output
optgroups
---------------------------------------------+-----------------------------
 Reporter:  goldenapples                     |       Owner:  johnbillion
     Type:  enhancement                      |      Status:  reopened
 Priority:  normal                           |   Milestone:  5.6
Component:  Administration                   |     Version:
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch commit has-unit-tests  |     Focuses:  ui,
                                             |  administration
---------------------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 The test added in [49190] fails on Windows, because the heredoc syntax
 (`<<<`) uses platform-specific EOLs, however
 `WP_List_Table::get_bulk_items()` specifically uses `\n`.

 [attachment:"19278.2.diff"] fixes the failure.

 In the future, this would probably benefit from something like
 `assertContainsIgnoreEOL()`, similar to `assertEqualsIgnoreEOL()` added in
 [46612] / #31432.

 However, since
 [https://github.com/sebastianbergmann/phpunit/blob/7.5.0/ChangeLog-7.5.md
 PHPUnit 7.5+] deprecates using `assertContains()` for strings and
 introduces `assertStringContainsString()` instead, let's skip adding a new
 method for now and just fix the test.

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


More information about the wp-trac mailing list