WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/29/2016 05:51:54 PM (4 years ago)
Author:
wonderboymusic
Message:

Media/Unit Tests: ensure that image sizes are indeed removed when errors are raised before assertions in Tests_Media.

See #36588.

File:
1 edited

Legend:

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

    r37035 r37328  
    585585        }
    586586
     587        remove_image_size( 'test-size' );
     588
    587589        $this->assertArrayNotHasKey( 'test-size', $_wp_additional_image_sizes );
    588590        add_image_size( 'test-size', 200, 600 );
    589         $this->assertArrayHasKey( 'test-size', $_wp_additional_image_sizes );
    590         $this->assertEquals( 200, $_wp_additional_image_sizes['test-size']['width'] );
    591         $this->assertEquals( 600, $_wp_additional_image_sizes['test-size']['height'] );
     591
     592        $sizes = $_wp_additional_image_sizes;
    592593
    593594        // Clean up
    594595        remove_image_size( 'test-size' );
     596
     597        $this->assertArrayHasKey( 'test-size', $sizes );
     598        $this->assertEquals( 200, $sizes['test-size']['width'] );
     599        $this->assertEquals( 600, $sizes['test-size']['height'] );
    595600    }
    596601
Note: See TracChangeset for help on using the changeset viewer.