| 2323 | |
| 2324 | public function test_wpmu_create_blog_cache_cleanup_backward_compatible() { |
| 2325 | add_action( 'populate_options', array( $this, 'populate_options_callback' ) ); |
| 2326 | |
| 2327 | $blog_id = wpmu_create_blog( "testsite1.example.org", "/test" , 'test', 1, array( 'public' => 1 ), 2 ); |
| 2328 | |
| 2329 | // Should not hit blog_details cache initialised in $this->populate_options_callback tirggered during |
| 2330 | // populate_options callback's call of get_blog_details. |
| 2331 | $this->assertEquals( 'http://testsite1.example.org/test', get_blog_details( $blog_id )->siteurl ); |
| 2332 | |
| 2333 | remove_action( 'populate_options', array( $this, 'populate_options_callback' ) ); |
| 2334 | } |
| 2335 | |
| 2336 | public function populate_options_callback() { |
| 2337 | // Cache blog details |
| 2338 | get_blog_details( get_current_blog_id() ); |
| 2339 | // Set siteurl |
| 2340 | update_option( 'siteurl', 'http://testsite1.example.org/test' ); |
| 2341 | } |