Make WordPress Core

Changeset 48949


Ignore:
Timestamp:
09/06/2020 03:35:59 AM (5 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r48948 r48949  
    4444
    4545        // You can store zero in the cache.
    46         $this->cache->add( $key, $val );
     46        $this->assertTrue( $this->cache->add( $key, $val ) );
    4747        $this->assertSame( $val, $this->cache->get( $key ) );
    4848    }
     
    5252        $val = null;
    5353
     54        // You can store null in the cache.
    5455        $this->assertTrue( $this->cache->add( $key, $val ) );
    55         // Null is converted to empty string.
    56         $this->assertEquals( '', $this->cache->get( $key ) );
     56        $this->assertSame( $val, $this->cache->get( $key ) );
    5757    }
    5858
Note: See TracChangeset for help on using the changeset viewer.