Changeset 47343 for branches/3.7/tests/phpunit/tests/ms.php
- Timestamp:
- 02/22/2020 12:05:12 PM (6 years ago)
- Location:
- branches/3.7
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/tests/ms.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.7
- Property svn:mergeinfo changed
-
branches/3.7/tests/phpunit/tests/ms.php
r25621 r47343 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 );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)