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:
Sergey Biryukov 2020-09-06 03:35:59 +00:00
parent 6f07ff569b
commit 944a6845a2

View File

@ -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() {