Make WordPress Core

Changeset 48950


Ignore:
Timestamp:
09/06/2020 04:23:46 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Add a test case for storing false in the cache.

Follow-up to [20089], [48949].

See #38266.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/cache.php

    r48949 r48950  
    4848    }
    4949
     50    /**
     51     * @ticket 20004
     52     */
    5053    function test_add_get_null() {
    5154        $key = __FUNCTION__;
    5255        $val = null;
    5356
    54         // You can store null in the cache.
     57        // You can store `null` in the cache.
     58        $this->assertTrue( $this->cache->add( $key, $val ) );
     59        $this->assertSame( $val, $this->cache->get( $key ) );
     60    }
     61
     62    /**
     63     * @ticket 20004
     64     */
     65    function test_add_get_false() {
     66        $key = __FUNCTION__;
     67        $val = false;
     68
     69        // You can store `false` in the cache.
    5570        $this->assertTrue( $this->cache->add( $key, $val ) );
    5671        $this->assertSame( $val, $this->cache->get( $key ) );
Note: See TracChangeset for help on using the changeset viewer.