mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Add remove_image_size() and tests for it and has_image_size(), added in [27128].
props mordauk, markoheijnen. fixes #26768. see #26951. git-svn-id: https://develop.svn.wordpress.org/trunk@27129 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -406,4 +406,35 @@ VIDEO;
|
||||
|
||||
$this->assertEquals( $expected, $content );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 26768
|
||||
*/
|
||||
function test_add_image_size() {
|
||||
global $_wp_additional_image_sizes;
|
||||
$this->assertArrayNotHasKey( 'test-size', $_wp_additional_image_sizes );
|
||||
add_image_size( 'test-size', 200, 600 );
|
||||
$this->assertArrayHasKey( 'test-size', $_wp_additional_image_sizes );
|
||||
$this->assertEquals( 200, $_wp_additional_image_sizes['test-size']['width'] );
|
||||
$this->assertEquals( 600, $_wp_additional_image_sizes['test-size']['height'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 26768
|
||||
*/
|
||||
function test_remove_image_size() {
|
||||
add_image_size( 'test-size', 200, 600 );
|
||||
$this->assertTrue( has_image_size( 'test-size' ) );
|
||||
remove_image_size( 'test-size' );
|
||||
$this->assertFalse( has_image_size( 'test-size' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 26951
|
||||
*/
|
||||
function test_has_image_size() {
|
||||
add_image_size( 'test-size', 200, 600 );
|
||||
$this->assertTrue( has_image_size( 'test-size' ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user