Make WordPress Core


Ignore:
Timestamp:
09/14/2026 03:52:03 PM (4 weeks ago)
Author:
lancewillett
Message:

Tests: Use a strict assertion for a falsey site option.

Assert that an option added with integer zero is returned as the string '0' after flushing the cache, matching the value read from the database.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13516

Props haritpanchal.
See #64895.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/option/siteOption.php

    r53865 r63613  
    219219                $this->assertTrue( update_site_option( $key, $value ) );
    220220                $this->flush_cache(); // Ensure we're getting the value from the DB.
    221                 $this->assertEquals( $value, get_site_option( $key ) );
     221                $this->assertSame( (string) $value, get_site_option( $key ) );
    222222        }
    223223
Note: See TracChangeset for help on using the changeset viewer.