Tests/admin/wpCommentsListTable: split the original test class and adjust covers notation#11844
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Trac ticket: https://core.trac.wordpress.org/ticket/65208
Splits the existing test class
Tests_Admin_wpCommentsListTableinto five focused test classes, one per method under test:Admin_WpCommentsListTable_ExtraTablenav_Test- coversWP_Comments_List_Table::extra_tablenavAdmin_WpCommentsListTable_BulkActions_Test- coversWP_Comments_List_Table::bulk_actionsAdmin_WpCommentsListTable_PrintColumnHeaders_Test- coversWP_Comments_List_Table::print_column_headersAdmin_WpCommentsListTable_GetViews_Test- coversWP_Comments_List_Table::get_viewsAdmin_WpCommentsListTable_PrepareItems_Test- coversWP_Comments_List_Table::prepare_itemsThe
@coversannotation is moved from method-level (repeated on each test) to a single class-level declaration in each new class. This makes all classes compatible with PHPUnit 11.No abstract
TestCasebase class was introduced since the sharedset_up()is a single line. ThePrintColumnHeadersclass constructs its own mock directly and needs noset_up()at all.Use of AI Tools
Used AI to debug test failures and refactor issues.