Ticket #31245: 31245.3.diff
File 31245.3.diff, 4.2 KB (added by , 8 years ago) |
---|
-
src/wp-includes/option.php
352 352 if ( ! wp_installing() ) { 353 353 $alloptions = wp_load_alloptions(); 354 354 if ( isset( $alloptions[$option] ) ) { 355 $alloptions[ $option ] = $serialized_value; 356 wp_cache_set( 'alloptions', $alloptions, 'options' ); 355 wp_cache_delete( 'alloptions', 'options' ); 357 356 } else { 358 357 wp_cache_set( $option, $serialized_value, 'options' ); 359 358 } … … 452 451 453 452 if ( ! wp_installing() ) { 454 453 if ( 'yes' == $autoload ) { 455 $alloptions = wp_load_alloptions(); 456 $alloptions[ $option ] = $serialized_value; 457 wp_cache_set( 'alloptions', $alloptions, 'options' ); 454 wp_cache_delete( 'alloptions', 'options' ); 458 455 } else { 459 456 wp_cache_set( $option, $serialized_value, 'options' ); 460 457 } … … 530 527 if ( 'yes' == $row->autoload ) { 531 528 $alloptions = wp_load_alloptions(); 532 529 if ( is_array( $alloptions ) && isset( $alloptions[$option] ) ) { 533 unset( $alloptions[$option] ); 534 wp_cache_set( 'alloptions', $alloptions, 'options' ); 530 wp_cache_delete( 'alloptions', 'options' ); 535 531 } 536 532 } else { 537 533 wp_cache_delete( $option, 'options' ); -
tests/phpunit/tests/customize/custom-css-setting.php
223 223 } 224 224 225 225 /** 226 * Test that wp_get_custom_css_post() doesn't query for a post after caching a failed lookup.227 *228 * @ticket 39259229 */230 function test_get_custom_css_post_queries_after_failed_lookup() {231 set_theme_mod( 'custom_css_post_id', -1 );232 $queries_before = get_num_queries();233 wp_get_custom_css_post();234 $this->assertSame( get_num_queries(), $queries_before );235 }236 237 /**238 226 * Test that wp_update_custom_css_post() updates the 'custom_css_post_id' theme mod. 239 227 * 240 228 * @ticket 39259 -
tests/phpunit/tests/option/updateOption.php
186 186 // Update the option using the same array with an object for the value. 187 187 $this->assertFalse( update_option( 'array_w_object', $array_w_object ) ); 188 188 189 // Check that no new database queries were performed.190 $this->assertEquals( $num_queries_pre_update, get_num_queries() );191 189 } 192 190 193 191 /** -
tests/phpunit/tests/term/getTerms.php
461 461 $this->assertEquals( 1, count( $terms ) ); 462 462 } 463 463 464 /**465 * @ticket 31118466 */467 public function test_child_of_should_skip_query_when_specified_parent_is_not_found_in_hierarchy_cache() {468 global $wpdb;469 470 register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true, ) );471 472 $terms = self::factory()->term->create_many( 3, array( 'taxonomy' => 'wptests_tax' ) );473 474 $num_queries = $wpdb->num_queries;475 476 $found = get_terms( 'wptests_tax', array(477 'hide_empty' => false,478 'child_of' => $terms[0],479 ) );480 481 $this->assertEmpty( $found );482 $this->assertSame( $num_queries, $wpdb->num_queries );483 }484 464 485 465 /** 486 466 * @ticket 31118 … … 1760 1740 } 1761 1741 1762 1742 /** 1763 * @ticket 311181764 */1765 public function test_parent_should_skip_query_when_specified_parent_is_not_found_in_hierarchy_cache() {1766 global $wpdb;1767 1768 register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true, ) );1769 1770 $terms = self::factory()->term->create_many( 3, array( 'taxonomy' => 'wptests_tax' ) );1771 1772 $num_queries = $wpdb->num_queries;1773 1774 $found = get_terms( 'wptests_tax', array(1775 'hide_empty' => false,1776 'parent' => $terms[0],1777 ) );1778 1779 $this->assertEmpty( $found );1780 $this->assertSame( $num_queries, $wpdb->num_queries );1781 }1782 1783 /**1784 1743 * @ticket 31118 1785 1744 */ 1786 1745 public function test_parent_should_respect_multiple_taxonomies() {