From 2c305659d33bc042a62afaa53a2cf749059191a8 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 4 Aug 2022 17:47:41 +0000 Subject: [PATCH] Tests: Use named data provider for `WP_Object_Cache::is_valid_key()` test. This makes the output when using the `--testdox` option more descriptive and is helpful when trying to debug which data set from a data provider failed the test. Follow-up to [53818], [53821], [53822], [53834]. See #56198. git-svn-id: https://develop.svn.wordpress.org/trunk@53835 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/cache.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/phpunit/tests/cache.php b/tests/phpunit/tests/cache.php index b6b7d62d62..f65096c597 100644 --- a/tests/phpunit/tests/cache.php +++ b/tests/phpunit/tests/cache.php @@ -59,18 +59,18 @@ class Tests_Cache extends WP_UnitTestCase { */ public function data_is_valid_key() { return array( - array( false, false ), - array( null, false ), - array( "\n", false ), - array( "\0", false ), - array( '', false ), - array( ' ', false ), - array( ' ', false ), - array( 0.0, false ), - array( 0, true ), - array( 1, true ), - array( '0', true ), - array( 'key', true ), + 'false' => array( false, false ), + 'null' => array( null, false ), + 'line break' => array( "\n", false ), + 'null character' => array( "\0", false ), + 'empty string' => array( '', false ), + 'single space' => array( ' ', false ), + 'two spaces' => array( ' ', false ), + 'float 0' => array( 0.0, false ), + 'int 0' => array( 0, true ), + 'int 1' => array( 1, true ), + 'string 0' => array( '0', true ), + 'string' => array( 'key', true ), ); }