Changeset 51869
- Timestamp:
- 09/25/2021 01:27:47 AM (3 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite.php
r51568 r51869 9 9 */ 10 10 class Tests_Multisite extends WP_UnitTestCase { 11 protected $suppress = false;12 13 function set_up() {14 global $wpdb;15 parent::set_up();16 $this->suppress = $wpdb->suppress_errors();17 }18 19 function tear_down() {20 global $wpdb;21 $wpdb->suppress_errors( $this->suppress );22 parent::tear_down();23 }24 11 25 12 function test_wpmu_log_new_registrations() { -
trunk/tests/phpunit/tests/multisite/cleanDirsizeCache.php
r51860 r51869 10 10 */ 11 11 class Tests_Multisite_CleanDirsizeCache extends WP_UnitTestCase { 12 protected $suppress = false;13 14 function set_up() {15 global $wpdb;16 parent::set_up();17 $this->suppress = $wpdb->suppress_errors();18 }19 20 function tear_down() {21 global $wpdb;22 $wpdb->suppress_errors( $this->suppress );23 parent::tear_down();24 }25 12 26 13 /** -
trunk/tests/phpunit/tests/multisite/getSpaceAllowed.php
r51860 r51869 9 9 */ 10 10 class Tests_Multisite_GetSpaceAllowed extends WP_UnitTestCase { 11 protected $suppress = false;12 13 public function set_up() {14 global $wpdb;15 parent::set_up();16 $this->suppress = $wpdb->suppress_errors();17 }18 19 public function tear_down() {20 global $wpdb;21 22 $wpdb->suppress_errors( $this->suppress );23 parent::tear_down();24 }25 11 26 12 /** -
trunk/tests/phpunit/tests/multisite/getSpaceUsed.php
r51860 r51869 8 8 */ 9 9 class Tests_Multisite_GetSpaceUsed extends WP_UnitTestCase { 10 protected $suppress = false;11 12 function set_up() {13 global $wpdb;14 parent::set_up();15 $this->suppress = $wpdb->suppress_errors();16 }17 18 function tear_down() {19 global $wpdb;20 $wpdb->suppress_errors( $this->suppress );21 parent::tear_down();22 }23 10 24 11 function test_get_space_used_switched_site() { -
trunk/tests/phpunit/tests/multisite/isUploadSpaceAvailable.php
r51860 r51869 12 12 */ 13 13 class Tests_Multisite_IsUploadSpaceAvailable extends WP_UnitTestCase { 14 protected $suppress = false;15 14 16 15 public function set_up() { 17 global $wpdb;18 16 parent::set_up(); 19 $this->suppress = $wpdb->suppress_errors();20 21 17 update_site_option( 'upload_space_check_disabled', false ); 22 }23 24 public function tear_down() {25 global $wpdb;26 27 $wpdb->suppress_errors( $this->suppress );28 parent::tear_down();29 18 } 30 19 -
trunk/tests/phpunit/tests/multisite/msFilesRewriting.php
r51860 r51869 13 13 */ 14 14 class Tests_Multisite_msFilesRewriting extends WP_UnitTestCase { 15 protected $suppress = false;16 15 17 16 function set_up() { 18 global $wpdb;19 17 parent::set_up(); 20 $this->suppress = $wpdb->suppress_errors();21 22 18 update_site_option( 'ms_files_rewriting', 1 ); 23 19 ms_upload_constants(); 24 }25 26 function tear_down() {27 global $wpdb;28 29 $wpdb->suppress_errors( $this->suppress );30 31 parent::tear_down();32 20 } 33 21 -
trunk/tests/phpunit/tests/multisite/network.php
r51568 r51869 11 11 class Tests_Multisite_Network extends WP_UnitTestCase { 12 12 protected $plugin_hook_count = 0; 13 protected $suppress = false;14 13 15 14 protected static $different_network_id; 16 15 protected static $different_site_ids = array(); 17 16 18 function set_up() {19 global $wpdb;20 parent::set_up();21 $this->suppress = $wpdb->suppress_errors();22 }23 24 17 function tear_down() { 25 global $wpdb, $current_site; 26 $wpdb->suppress_errors( $this->suppress ); 18 global $current_site; 27 19 $current_site->id = 1; 28 20 parent::tear_down(); … … 591 583 */ 592 584 public function test_wpmu_create_blog_updates_correct_network_site_count() { 585 global $wpdb; 586 593 587 $original_count = get_blog_count( self::$different_network_id ); 594 588 595 $site_id = wpmu_create_blog( 'example.org', '/', '', 1, array(), self::$different_network_id ); 589 $suppress = $wpdb->suppress_errors(); 590 $site_id = wpmu_create_blog( 'example.org', '/', '', 1, array(), self::$different_network_id ); 591 $wpdb->suppress_errors( $suppress ); 596 592 597 593 $result = get_blog_count( self::$different_network_id ); -
trunk/tests/phpunit/tests/multisite/uploadIsUserOverQuota.php
r51860 r51869 12 12 */ 13 13 class Tests_Multisite_UploadIsUserOverQuota extends WP_UnitTestCase { 14 protected $suppress = false;15 14 16 15 public function set_up() { 17 global $wpdb;18 16 parent::set_up(); 19 $this->suppress = $wpdb->suppress_errors();20 21 17 update_site_option( 'upload_space_check_disabled', false ); 22 }23 24 public function tear_down() {25 global $wpdb;26 $wpdb->suppress_errors( $this->suppress );27 parent::tear_down();28 18 } 29 19 -
trunk/tests/phpunit/tests/multisite/wpNetworkQuery.php
r51860 r51869 12 12 class Tests_Multisite_wpNetworkQuery extends WP_UnitTestCase { 13 13 protected static $network_ids; 14 15 protected $suppress = false;16 17 function set_up() {18 global $wpdb;19 parent::set_up();20 $this->suppress = $wpdb->suppress_errors();21 }22 23 function tear_down() {24 global $wpdb;25 $wpdb->suppress_errors( $this->suppress );26 parent::tear_down();27 }28 14 29 15 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { -
trunk/tests/phpunit/tests/multisite/wpSiteQuery.php
r51860 r51869 12 12 protected static $network_ids; 13 13 protected static $site_ids; 14 15 protected $suppress = false;16 17 function set_up() {18 global $wpdb;19 parent::set_up();20 $this->suppress = $wpdb->suppress_errors();21 }22 23 function tear_down() {24 global $wpdb;25 $wpdb->suppress_errors( $this->suppress );26 parent::tear_down();27 }28 14 29 15 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { -
trunk/tests/phpunit/tests/option/multisite.php
r51568 r51869 11 11 */ 12 12 class Tests_Multisite_Option extends WP_UnitTestCase { 13 protected $suppress = false;14 15 function set_up() {16 global $wpdb;17 parent::set_up();18 $this->suppress = $wpdb->suppress_errors();19 }20 21 function tear_down() {22 global $wpdb;23 $wpdb->suppress_errors( $this->suppress );24 parent::tear_down();25 }26 13 27 14 function test_from_same_site() { -
trunk/tests/phpunit/tests/user/multisite.php
r51568 r51869 11 11 */ 12 12 class Tests_Multisite_User extends WP_UnitTestCase { 13 protected $suppress = false;14 15 function set_up() {16 global $wpdb;17 parent::set_up();18 $this->suppress = $wpdb->suppress_errors();19 }20 21 function tear_down() {22 global $wpdb;23 $wpdb->suppress_errors( $this->suppress );24 parent::tear_down();25 }26 13 27 14 function test_remove_user_from_blog() { … … 396 383 */ 397 384 public function test_add_user_to_blog_invalid_user() { 385 global $wpdb; 386 398 387 $site_id = self::factory()->blog->create(); 399 388 400 $result = add_user_to_blog( 73622, $site_id, 'subscriber' ); 389 $suppress = $wpdb->suppress_errors(); 390 $result = add_user_to_blog( 73622, $site_id, 'subscriber' ); 391 $wpdb->suppress_errors( $suppress ); 401 392 402 393 wp_delete_site( $site_id );
Note: See TracChangeset
for help on using the changeset viewer.