Ticket #22846: 22846.3.diff
File 22846.3.diff, 2.6 KB (added by , 8 years ago) |
---|
-
src/wp-includes/option.php
1223 1223 $notoptions_key = "$network_id:notoptions"; 1224 1224 1225 1225 if ( ! is_multisite() ) { 1226 $result = add_option( $option, $value );1226 $result = add_option( $option, $value, '', 'no' ); 1227 1227 } else { 1228 1228 $cache_key = "$network_id:$option"; 1229 1229 … … 1431 1431 } 1432 1432 1433 1433 if ( ! is_multisite() ) { 1434 $result = update_option( $option, $value );1434 $result = update_option( $option, $value, 'no' ); 1435 1435 } else { 1436 1436 $value = sanitize_option( $option, $value ); 1437 1437 -
tests/phpunit/tests/option/networkOption.php
53 53 } 54 54 55 55 /** 56 * @ticket 22846 57 */ 58 public function test_add_network_option_is_not_stored_as_autoload_option() { 59 $key = rand_str(); 60 61 if ( is_multisite() ) { 62 $this->markTestSkipped( 'Does not apply when used in multisite.' ); 63 } 64 65 add_network_option( null, $key, 'Not an autoload option' ); 66 67 $options = wp_load_alloptions(); 68 69 $this->assertFalse( isset( $options[ $key ] ) ); 70 } 71 72 /** 73 * @ticket 22846 74 */ 75 public function test_update_network_option_is_not_stored_as_autoload_option() { 76 $key = rand_str(); 77 78 if ( is_multisite() ) { 79 $this->markTestSkipped( 'Does not apply when used in multisite.' ); 80 } 81 82 update_network_option( null, $key, 'Not an autoload option' ); 83 84 $options = wp_load_alloptions(); 85 86 $this->assertFalse( isset( $options[ $key ] ) ); 87 } 88 89 /** 56 90 * @dataProvider data_network_id_parameter 57 91 * 58 92 * @param $network_id -
tests/phpunit/tests/option/siteTransient.php
41 41 $this->assertEquals( $value, get_site_transient( $key ) ); 42 42 $this->assertTrue( delete_site_transient( $key ) ); 43 43 } 44 45 /** 46 * @ticket 22846 47 */ 48 public function test_set_site_transient_is_not_stored_as_autoload_option() { 49 $key = rand_str(); 50 51 if ( is_multisite() ) { 52 $this->markTestSkipped( 'Does not apply when used in multisite.' ); 53 } 54 set_site_transient( $key, 'Not an autoload option' ); 55 56 $options = wp_load_alloptions(); 57 58 $this->assertFalse( isset( $options[ '_site_transient_' . $key ] ) ); 59 } 44 60 }