mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-14 01:24:27 +00:00
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:
@@ -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 ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user