Make WordPress Core


Ignore:
Timestamp:
07/13/2021 04:13:01 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Reset $current_screen global between tests to avoid cross-test interdependencies.

This provides a consistent global starting state for tests that interact with admin screens.

Individual tests no longer need to invoke set_current_screen( 'front' ) (or an alternative implementation) as a reset.

Follow-up to [29251], [29860], [31046], [36721], [38678], [48908], [50433].

Props hellofromTonya, johnbillion.
Fixes #53431.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/attachments.php

    r51403 r51419  
    411411        $url = wp_get_attachment_url( $attachment_id );
    412412
    413         // Cleanup.
    414         set_current_screen( 'front' );
    415 
    416413        $this->assertSame( set_url_scheme( $url, 'http' ), $url );
    417414    }
     
    439436
    440437        // Cleanup.
    441         set_current_screen( 'front' );
    442438        remove_filter( 'upload_dir', '_upload_dir_https' );
    443439
Note: See TracChangeset for help on using the changeset viewer.