summaryrefslogtreecommitdiffstatshomepage
path: root/tests/phpunit
diff options
context:
space:
mode:
authorSergey Biryukov <sergeybiryukov@git.wordpress.org>2020-09-06 03:35:59 +0000
committerSergey Biryukov <sergeybiryukov@git.wordpress.org>2020-09-06 03:35:59 +0000
commit944a6845a251cd52e1c4e18f290a3a9402d0b08b (patch)
tree1eaac94ee90b0c7d87d3785ce270c0ec7d58a905 /tests/phpunit
parent6f07ff569bf012e1f57018437add3b959a2b2235 (diff)
downloadwordpress-944a6845a251cd52e1c4e18f290a3a9402d0b08b.tar.gz
wordpress-944a6845a251cd52e1c4e18f290a3a9402d0b08b.zip
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
Diffstat (limited to 'tests/phpunit')
-rw-r--r--tests/phpunit/tests/cache.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/phpunit/tests/cache.php b/tests/phpunit/tests/cache.php
index c47ce4a8da..740332503c 100644
--- a/tests/phpunit/tests/cache.php
+++ b/tests/phpunit/tests/cache.php
@@ -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() {