From 559c8205cf5c6346c220adf00a812db01b4ca365 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 19 Sep 2022 14:15:10 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@54203 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/kses.php | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/tests/phpunit/tests/kses.php b/tests/phpunit/tests/kses.php index 5871f0fe33..7ec4a660ed 100644 --- a/tests/phpunit/tests/kses.php +++ b/tests/phpunit/tests/kses.php @@ -2090,19 +2090,13 @@ HTML; * @return array */ public function data_kses_globals_are_defined() { - return array( - 'allowedposttags' => array( - 'global' => 'allowedposttags', - ), - 'allowedtags' => array( - 'global' => 'allowedtags', - ), - 'allowedentitynames' => array( - 'global' => 'allowedentitynames', - ), - 'allowedxmlentitynames' => array( - 'global' => 'allowedxmlentitynames', - ), + $globals = array( + 'allowedposttags', + 'allowedtags', + 'allowedentitynames', + 'allowedxmlentitynames', ); + + return $this->text_array_to_dataprovider( $globals ); } }