Tests: Add a test case with a float value for WP_Object_Cache::is_valid_key().

A valid cache key for `wp_cache_*()` functions must be either an integer number or a non-empty string. To avoid potential compatibility issues or key collisions, float values should not be considered a valid cache key.

Follow-up to [53818], [53821].

Props tillkruess, malthert, spacedmonkey.
See #56198.

git-svn-id: https://develop.svn.wordpress.org/trunk@53822 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2022-08-04 12:35:28 +00:00
parent a164d64275
commit dc0672616c

View File

@ -61,6 +61,7 @@ class Tests_Cache extends WP_UnitTestCase {
array( false, false ),
array( null, false ),
array( '', false ),
array( 0.0, false ),
array( 0, true ),
array( 1, true ),
array( '0', true ),