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:
parent
944a6845a2
commit
83f23c4c4f
|
@ -47,11 +47,26 @@ class Tests_Cache extends WP_UnitTestCase {
|
||||||
$this->assertSame( $val, $this->cache->get( $key ) );
|
$this->assertSame( $val, $this->cache->get( $key ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ticket 20004
|
||||||
|
*/
|
||||||
function test_add_get_null() {
|
function test_add_get_null() {
|
||||||
$key = __FUNCTION__;
|
$key = __FUNCTION__;
|
||||||
$val = null;
|
$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->assertTrue( $this->cache->add( $key, $val ) );
|
||||||
$this->assertSame( $val, $this->cache->get( $key ) );
|
$this->assertSame( $val, $this->cache->get( $key ) );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue