Changeset 41244 for trunk/tests/phpunit/tests/customize/manager.php
- Timestamp:
- 08/13/2017 12:56:24 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/manager.php
r41243 r41244 171 171 $this->assertContains( 'Invalid changeset UUID', $exception->getMessage() ); 172 172 173 update_option( 'fresh_site', 0);173 update_option( 'fresh_site', '0' ); 174 174 $wp_customize = new WP_Customize_Manager(); 175 175 $wp_customize->setup_theme(); … … 177 177 178 178 // Make sure that starter content import gets queued on a fresh site. 179 update_option( 'fresh_site', 1);179 update_option( 'fresh_site', '1' ); 180 180 $wp_customize->setup_theme(); 181 181 $this->assertEquals( 100, has_action( 'after_setup_theme', array( $wp_customize, 'import_theme_starter_content' ) ) ); 182 } 183 184 /** 185 * Test that clearing a fresh site is a no-op if the site is already fresh. 186 * 187 * @see _delete_option_fresh_site() 188 * @ticket 41039 189 */ 190 function test_fresh_site_flag_clearing() { 191 global $wp_customize, $wpdb; 192 193 // Make sure fresh site flag is cleared when publishing a changeset. 194 update_option( 'fresh_site', '1' ); 195 do_action( 'customize_save_after', $wp_customize ); 196 $this->assertEquals( '0', get_option( 'fresh_site' ) ); 197 198 // Simulate a new, uncached request. 199 wp_cache_delete( 'alloptions', 'options' ); 200 wp_load_alloptions(); 201 202 // Make sure no DB write is done when publishing and a site is already non-fresh. 203 $query_count = $wpdb->num_queries; 204 do_action( 'customize_save_after', $wp_customize ); 205 $this->assertSame( $query_count, $wpdb->num_queries ); 182 206 } 183 207
Note: See TracChangeset
for help on using the changeset viewer.