Tests: Add a test case for storing `false` in the cache.

Follow-up to [20089], [48949].

See #38266.

git-svn-id: https://develop.svn.wordpress.org/trunk@48950 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-09-06 04:23:46 +00:00
parent 944a6845a2
commit 83f23c4c4f
1 changed files with 16 additions and 1 deletions

View File

@ -47,11 +47,26 @@ class Tests_Cache extends WP_UnitTestCase {
$this->assertSame( $val, $this->cache->get( $key ) );
}
/**
* @ticket 20004
*/
function test_add_get_null() {
$key = __FUNCTION__;
$val = null;
// You can store null in the cache.
// You can store `null` in the cache.
$this->assertTrue( $this->cache->add( $key, $val ) );
$this->assertSame( $val, $this->cache->get( $key ) );
}
/**
* @ticket 20004
*/
function test_add_get_false() {
$key = __FUNCTION__;
$val = false;
// You can store `false` in the cache.
$this->assertTrue( $this->cache->add( $key, $val ) );
$this->assertSame( $val, $this->cache->get( $key ) );
}