Ticket #20950: 20950-ut.diff
File 20950-ut.diff, 1.9 KB (added by , 11 years ago) |
---|
-
tests/ms.php
19 19 $this->assertInternalType( 'int', $blog_id ); 20 20 $prefix = $wpdb->get_blog_prefix( $blog_id ); 21 21 22 $details = get_blog_details( $blog_id, false ); 23 $this->assertEquals( $blog_id, get_id_from_blogname( $details->path ) ); 24 $this->assertEquals( $blog_id, wp_cache_get( 'get_id_from_blogname_' . trim( $details->path, '/' ), 'blog-details' ) ); 25 22 26 foreach ( $wpdb->tables( 'blog', false ) as $table ) { 23 27 $wpdb->suppress_errors(); 24 28 $table_fields = $wpdb->get_results( "DESCRIBE $prefix$table;" ); … … 41 45 foreach ( $blog_ids as $blog_id ) { 42 46 // drop tables for every second blog 43 47 $drop_tables = ! $drop_tables; 48 $details = get_blog_details( $blog_id, false ); 44 49 wpmu_delete_blog( $blog_id, $drop_tables ); 45 50 51 $this->assertEquals( false, wp_cache_get( 'get_id_from_blogname_' . trim( $details->path, '/' ), 'blog-details' ) ); 52 46 53 $prefix = $wpdb->get_blog_prefix( $blog_id ); 47 54 foreach ( $wpdb->tables( 'blog', false ) as $table ) { 48 55 $wpdb->suppress_errors(); -
includes/factory.php
97 97 class WP_UnitTest_Factory_For_Blog extends WP_UnitTest_Factory_For_Thing { 98 98 99 99 function __construct( $factory = null ) { 100 global $current_site ;100 global $current_site, $base; 101 101 parent::__construct( $factory ); 102 102 $this->default_generation_definitions = array( 103 103 'domain' => $current_site->domain, 104 'path' => new WP_UnitTest_Generator_Sequence( 'testpath%s' ),104 'path' => new WP_UnitTest_Generator_Sequence( $base . 'testpath%s' ), 105 105 'title' => new WP_UnitTest_Generator_Sequence( 'Site %s' ), 106 106 'site_id' => $current_site->id, 107 107 );