Make WordPress Core


Ignore:
Timestamp:
02/26/2016 02:08:47 AM (9 years ago)
Author:
johnbillion
Message:

Remove (or at least reduce) the need to reset common $_SERVER variables before assertions or between tests, by introducing a method which automatically resets them during test setup.

See #35954

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rewrite.php

    r36711 r36721  
    104104
    105105    function test_url_to_postid_set_url_scheme_http_to_https() {
    106         // Save server data for cleanup
    107         $is_ssl = is_ssl();
    108 
    109106        $_SERVER['HTTPS'] = 'on';
    110107
     
    116113        $page_permalink = get_permalink( $page_id );
    117114        $page_url_to_id = url_to_postid( set_url_scheme( $page_permalink, 'http' ) );
    118 
    119         // Cleanup.
    120         $_SERVER['HTTPS'] = $is_ssl ? 'on' : 'off';
    121115
    122116        $this->assertEquals( $post_id, $post_url_to_id );
Note: See TracChangeset for help on using the changeset viewer.