Make WordPress Core

Changeset 430 in tests


Ignore:
Timestamp:
08/24/2011 08:03:20 PM (13 years ago)
Author:
duck_
Message:

Test update_site_option and falsey values, see #WP15497

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_option.php

    r422 r430  
    9595        $this->assertTrue( delete_site_option( $key ) );
    9696    }
     97
     98    // #15497 - ensure update_site_option will add options with false-y values
     99    function test_update_adds_falsey_value() {
     100        global $wpdb;
     101        $key = rand_str();
     102        $value = 0;
     103
     104        delete_site_option( $key );
     105        $this->assertTrue( update_site_option( $key, $value ) );
     106        wp_cache_flush(); // ensure we're getting the value from the DB
     107        $this->assertEquals( $value, get_site_option( $key ) );
     108    }
    97109}
    98110
Note: See TracChangeset for help on using the changeset viewer.