Changeset 26252
- Timestamp:
- 11/18/2013 08:44:34 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/upgrade.php
r26251 r26252 1554 1554 1555 1555 // Fetch the table column structure from the database 1556 $ wpdb->suppress_errors();1556 $suppress = $wpdb->suppress_errors(); 1557 1557 $tablefields = $wpdb->get_results("DESCRIBE {$table};"); 1558 $wpdb->suppress_errors( false);1558 $wpdb->suppress_errors( $suppress ); 1559 1559 1560 1560 if ( ! $tablefields ) -
trunk/src/wp-includes/ms-functions.php
r26120 r26252 1130 1130 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 1131 1131 1132 $ wpdb->suppress_errors();1132 $suppress = $wpdb->suppress_errors(); 1133 1133 if ( $wpdb->get_results( "DESCRIBE {$wpdb->posts}" ) ) 1134 1134 die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p></body></html>' ); 1135 $wpdb->suppress_errors( false);1135 $wpdb->suppress_errors( $suppress ); 1136 1136 1137 1137 $url = get_blogaddress_by_id( $blog_id ); … … 1180 1180 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 1181 1181 1182 $ wpdb->suppress_errors();1182 $suppress = $wpdb->suppress_errors(); 1183 1183 1184 1184 wp_install_defaults($user_id); 1185 1185 1186 $wpdb->suppress_errors( false);1186 $wpdb->suppress_errors( $suppress ); 1187 1187 } 1188 1188 -
trunk/tests/phpunit/includes/factory.php
r25660 r26252 160 160 161 161 function create_object( $args ) { 162 global $wpdb; 162 163 $meta = isset( $args['meta'] ) ? $args['meta'] : array(); 163 164 $user_id = isset( $args['user_id'] ) ? $args['user_id'] : get_current_user_id(); 164 return wpmu_create_blog( $args['domain'], $args['path'], $args['title'], $user_id, $meta, $args['site_id'] ); 165 // temp tables will trigger db errors when we attempt to reference them as new temp tables 166 $suppress = $wpdb->suppress_errors(); 167 $blog = wpmu_create_blog( $args['domain'], $args['path'], $args['title'], $user_id, $meta, $args['site_id'] ); 168 $wpdb->suppress_errors( $suppress ); 169 return $blog; 165 170 } 166 171 -
trunk/tests/phpunit/tests/ms.php
r25621 r26252 10 10 class Tests_MS extends WP_UnitTestCase { 11 11 protected $plugin_hook_count = 0; 12 protected $suppress = false; 12 13 13 14 function setUp() { 15 global $wpdb; 14 16 parent::setUp(); 17 $this->suppress = $wpdb->suppress_errors(); 15 18 16 19 $_SERVER['REMOTE_ADDR'] = ''; 20 } 21 22 function tearDown() { 23 global $wpdb; 24 parent::tearDown(); 25 $wpdb->suppress_errors( $this->suppress ); 17 26 } 18 27 … … 106 115 107 116 foreach ( $wpdb->tables( 'blog', false ) as $table ) { 108 $ wpdb->suppress_errors();117 $suppress = $wpdb->suppress_errors(); 109 118 $table_fields = $wpdb->get_results( "DESCRIBE $prefix$table;" ); 110 $wpdb->suppress_errors( false);119 $wpdb->suppress_errors( $suppress ); 111 120 $this->assertNotEmpty( $table_fields ); 112 121 $result = $wpdb->get_results( "SELECT * FROM $prefix$table LIMIT 1" ); … … 140 149 $prefix = $wpdb->get_blog_prefix( $blog_id ); 141 150 foreach ( $wpdb->tables( 'blog', false ) as $table ) { 142 $ wpdb->suppress_errors();151 $suppress = $wpdb->suppress_errors(); 143 152 $table_fields = $wpdb->get_results( "DESCRIBE $prefix$table;" ); 144 $wpdb->suppress_errors( false);153 $wpdb->suppress_errors( $suppress ); 145 154 if ( $drop_tables ) 146 155 $this->assertEmpty( $table_fields ); -
trunk/tests/phpunit/tests/option/blogOption.php
r25397 r26252 6 6 */ 7 7 class Tests_Option_BlogOption extends WP_UnitTestCase { 8 protected $suppress = false; 9 8 10 function setUp() { 11 global $wpdb; 9 12 parent::setUp(); 13 $this->suppress = $wpdb->suppress_errors(); 10 14 11 15 $_SERVER['REMOTE_ADDR'] = null; 16 } 17 18 function tearDown() { 19 global $wpdb; 20 parent::tearDown(); 21 $wpdb->suppress_errors( $this->suppress ); 12 22 } 13 23
Note: See TracChangeset
for help on using the changeset viewer.