File tree Expand file tree Collapse file tree
tests/phpunit/tests/option Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,17 +114,20 @@ function test_delete_site_option_returns_false_if_option_does_not_exist() {
114114 $ this ->assertFalse ( delete_site_option ( $ key ) );
115115 }
116116
117- function test_serialized_data () {
117+ function test_site_option_add_and_get_serialized_array () {
118118 $ key = rand_str ();
119119 $ value = array ( 'foo ' => true , 'bar ' => true );
120-
121- $ this ->assertTrue ( add_site_option ( $ key , $ value ) );
120+ add_site_option ( $ key , $ value );
122121 $ this ->assertEquals ( $ value , get_site_option ( $ key ) );
122+ }
123123
124- $ value = (object ) $ value ;
125- $ this ->assertTrue ( update_site_option ( $ key , $ value ) );
124+ function test_site_option_add_and_get_serialized_object () {
125+ $ key = rand_str ();
126+ $ value = new stdClass ();
127+ $ value ->foo = true ;
128+ $ value ->bar = true ;
129+ add_site_option ( $ key , $ value );
126130 $ this ->assertEquals ( $ value , get_site_option ( $ key ) );
127- $ this ->assertTrue ( delete_site_option ( $ key ) );
128131 }
129132
130133 // #15497 - ensure update_site_option will add options with false-y values
You can’t perform that action at this time.
0 commit comments