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
This commit is contained in:
Sergey Biryukov 2022-08-04 17:47:41 +00:00
parent 74c8b7f2de
commit 2c305659d3

View File

@ -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 ),
);
}