Make WordPress Core

Changeset 64010


Ignore:
Timestamp:
09/29/2026 11:28:12 PM (6 weeks ago)
Author:
lancewillett
Message:

Tests: Make meta test data providers static.

Declare the five data providers in the meta tests static to prepare for newer PHPUnit versions. The providers do not depend on instance state, and their test data and assertions remain unchanged.

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

Props irozum.
See #66211.

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

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/meta/isProtectedMeta.php

    r56547 r64010  
    1414        }
    1515
    16         public function data_is_protected_meta_true() {
     16        public static function data_is_protected_meta_true() {
    1717                $protected_keys = array(
    1818                        array( '_wp_attachment' ),
    … …  
    3636        }
    3737
    38         public function data_is_protected_meta_false() {
     38        public static function data_is_protected_meta_false() {
    3939                $unprotected_keys = array(
    4040                        array( 'singleword' ),
  • trunk/tests/phpunit/tests/meta/registerMeta.php

    r63603 r64010  
    612612        }
    613613
    614         public function data_get_default_data() {
     614        public static function data_get_default_data() {
    615615                return array(
    616616                        'single string key with single ask '          => array(
    … …  
    954954        }
    955955
    956         public function data_get_invalid_default_data() {
     956        public static function data_get_invalid_default_data() {
    957957                return array(
    958958                        array(
    … …  
    11071107        }
    11081108
    1109         public function data_get_types_and_subtypes() {
     1109        public static function data_get_types_and_subtypes() {
    11101110                return array(
    11111111                        array( 'post', 'page' ),
Note: See TracChangeset for help on using the changeset viewer.