Make WordPress Core


Ignore:
Timestamp:
09/25/2021 01:27:47 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Tests: Remove unnecessary setUp() and tearDown() methods in multisite tests.

These were originally added in [26252] to suppress database errors on setUp() and restore on tearDown() for tests that call wpmu_create_blog(), blog factory, or installation code that attempts to clear transients.

As the multisite test coverage expanded, these methods ended up being unnecessarily copied into other test classes, where database error suppression is not required.

Follow-up to [26252], [29916], [30286], [33184], [34898], [34899], [34901], [37234], [37477], [37894], [49212], [49616], [51859].

See #53363.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/multisite/msFilesRewriting.php

    r51860 r51869  
    1313     */
    1414    class Tests_Multisite_msFilesRewriting extends WP_UnitTestCase {
    15         protected $suppress = false;
    1615
    1716        function set_up() {
    18             global $wpdb;
    1917            parent::set_up();
    20             $this->suppress = $wpdb->suppress_errors();
    21 
    2218            update_site_option( 'ms_files_rewriting', 1 );
    2319            ms_upload_constants();
    24         }
    25 
    26         function tear_down() {
    27             global $wpdb;
    28 
    29             $wpdb->suppress_errors( $this->suppress );
    30 
    31             parent::tear_down();
    3220        }
    3321
Note: See TracChangeset for help on using the changeset viewer.