Make WordPress Core

Changeset 27358


Ignore:
Timestamp:
03/02/2014 10:22:41 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Restore $content_width global value after changing it in test_constrain_size_for_editor_*().

props ericlewis, georgestephanis, salcode, jorbin.
fixes #27256.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/image/size.php

    r25409 r27358  
    174174        // default max width is 500, no constraint on height
    175175        global $content_width;
     176
     177        $_content_width = $content_width;
     178
    176179        $content_width = 0;
    177180        update_option('medium_size_w', 500);
     
    191194        $out = image_constrain_size_for_editor(600, 400, 'medium');
    192195        $this->assertEquals(array(500, 333), $out);
     196
     197        $content_width = $_content_width;
    193198    }
    194199
    195200    function test_constrain_size_for_editor_full() {
    196201        global $content_width;
     202
     203        $_content_width = $content_width;
     204
    197205        $content_width = 400;
    198206        $out = image_constrain_size_for_editor(600, 400, 'full');
     
    210218        $out = image_constrain_size_for_editor(64, 64, 'full');
    211219        $this->assertEquals(array(64, 64), $out);
     220
     221        $content_width = $_content_width;
    212222    }
    213223
Note: See TracChangeset for help on using the changeset viewer.