Make WordPress Core


Ignore:
Timestamp:
09/19/2022 02:15:10 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Tests: Simplify the data provider for testing whether KSES globals are defined.

To avoid duplicating array values as keys when using a named data provider, the text_array_to_dataprovider() helper method can be used.

Follow-up to [52229], [53521].

See #55652.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/kses.php

    r54117 r54203  
    20912091     */
    20922092    public function data_kses_globals_are_defined() {
    2093         return array(
    2094             'allowedposttags'       => array(
    2095                 'global' => 'allowedposttags',
    2096             ),
    2097             'allowedtags'           => array(
    2098                 'global' => 'allowedtags',
    2099             ),
    2100             'allowedentitynames'    => array(
    2101                 'global' => 'allowedentitynames',
    2102             ),
    2103             'allowedxmlentitynames' => array(
    2104                 'global' => 'allowedxmlentitynames',
    2105             ),
    2106         );
     2093        $globals = array(
     2094            'allowedposttags',
     2095            'allowedtags',
     2096            'allowedentitynames',
     2097            'allowedxmlentitynames',
     2098        );
     2099
     2100        return $this->text_array_to_dataprovider( $globals );
    21072101    }
    21082102}
Note: See TracChangeset for help on using the changeset viewer.