Make WordPress Core


Ignore:
Timestamp:
02/08/2014 12:40:15 AM (12 years ago)
Author:
nacin
Message:

Add remove_image_size() and tests for it and has_image_size(), added in [27128].

props mordauk, markoheijnen.
fixes #26768. see #26951.

File:
1 edited

Legend:

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

    r27100 r27129  
    407407        $this->assertEquals( $expected, $content );
    408408    }
     409
     410    /**
     411     * @ticket 26768
     412     */
     413    function test_add_image_size() {
     414        global $_wp_additional_image_sizes;
     415        $this->assertArrayNotHasKey( 'test-size', $_wp_additional_image_sizes );
     416        add_image_size( 'test-size', 200, 600 );
     417        $this->assertArrayHasKey( 'test-size', $_wp_additional_image_sizes );
     418        $this->assertEquals( 200, $_wp_additional_image_sizes['test-size']['width'] );
     419        $this->assertEquals( 600, $_wp_additional_image_sizes['test-size']['height'] );
     420    }
     421
     422    /**
     423     * @ticket 26768
     424     */
     425    function test_remove_image_size() {
     426        add_image_size( 'test-size', 200, 600 );
     427        $this->assertTrue( has_image_size( 'test-size' ) );
     428        remove_image_size( 'test-size' );
     429        $this->assertFalse( has_image_size( 'test-size' ) );
     430    }
     431
     432    /**
     433     * @ticket 26951
     434     */
     435    function test_has_image_size() {
     436        add_image_size( 'test-size', 200, 600 );
     437        $this->assertTrue( has_image_size( 'test-size' ) );
     438    }
     439
    409440}
Note: See TracChangeset for help on using the changeset viewer.