From 34a58febd8592b5d178a985462d85bbb72af8d93 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 11 Oct 2014 04:22:11 +0000 Subject: [PATCH] Ensure themes don't have to call add_image_size() to be used in unit tests. props mboynes. fixes #29924. git-svn-id: https://develop.svn.wordpress.org/trunk@29874 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/media.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php index cc886933d9..e2bb99222b 100644 --- a/tests/phpunit/tests/media.php +++ b/tests/phpunit/tests/media.php @@ -413,6 +413,11 @@ VIDEO; */ function test_add_image_size() { global $_wp_additional_image_sizes; + + if ( ! isset( $_wp_additional_image_sizes ) ) { + $_wp_additional_image_sizes = array(); + } + $this->assertArrayNotHasKey( 'test-size', $_wp_additional_image_sizes ); add_image_size( 'test-size', 200, 600 ); $this->assertArrayHasKey( 'test-size', $_wp_additional_image_sizes );