Make WordPress Core

Changeset 64081


Ignore:
Timestamp:
10/03/2026 06:48:44 PM (5 weeks ago)
Author:
lancewillett
Message:

Tests: Make hook test data providers static.

Declare the four data providers in the WP_Hook::apply_filters() and WP_Hook::do_action() tests as public static for compatibility with newer PHPUnit versions. The providers return literal data and do not require instance state.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13967

Props pablodiloreto.
See #66211.

Location:
trunk/tests/phpunit/tests/hooks
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/hooks/applyFilters.php

    r57257 r64081  
    8484         * @return array[]
    8585         */
    86         public function data_priority_callback_order_with_integers() {
     86        public static function data_priority_callback_order_with_integers() {
    8787                return array(
    8888                        'int DESC' => array(
    … …  
    102102         * @return array[]
    103103         */
    104         public function data_priority_callback_order_with_unhappy_path_nonintegers() {
     104        public static function data_priority_callback_order_with_unhappy_path_nonintegers() {
    105105                return array(
    106106                        // Numbers as strings and floats.
  • trunk/tests/phpunit/tests/hooks/doAction.php

    r57257 r64081  
    126126         * @return array[]
    127127         */
    128         public function data_priority_callback_order_with_integers() {
     128        public static function data_priority_callback_order_with_integers() {
    129129                return array(
    130130                        'int DESC' => array(
    … …  
    144144         * @return array[]
    145145         */
    146         public function data_priority_callback_order_with_unhappy_path_nonintegers() {
     146        public static function data_priority_callback_order_with_unhappy_path_nonintegers() {
    147147                return array(
    148148                        // Numbers as strings and floats.
Note: See TracChangeset for help on using the changeset viewer.