Tests: Correct assertion in Tests_Cache::test_add_get_null()
.
It is possible to store `null` in the cache without it being converted to an empty string. Follow-up to [20089]. Props johnbillion, SergeyBiryukov. See #38266. git-svn-id: https://develop.svn.wordpress.org/trunk@48949 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6f07ff569b
commit
944a6845a2
@ -43,7 +43,7 @@ class Tests_Cache extends WP_UnitTestCase {
|
||||
$val = 0;
|
||||
|
||||
// You can store zero in the cache.
|
||||
$this->cache->add( $key, $val );
|
||||
$this->assertTrue( $this->cache->add( $key, $val ) );
|
||||
$this->assertSame( $val, $this->cache->get( $key ) );
|
||||
}
|
||||
|
||||
@ -51,9 +51,9 @@ class Tests_Cache extends WP_UnitTestCase {
|
||||
$key = __FUNCTION__;
|
||||
$val = null;
|
||||
|
||||
// You can store null in the cache.
|
||||
$this->assertTrue( $this->cache->add( $key, $val ) );
|
||||
// Null is converted to empty string.
|
||||
$this->assertEquals( '', $this->cache->get( $key ) );
|
||||
$this->assertSame( $val, $this->cache->get( $key ) );
|
||||
}
|
||||
|
||||
function test_add() {
|
||||
|
Loading…
Reference in New Issue
Block a user