Media/Unit Tests: ensure that the GD absrtraction is used for GD unit tests for Images. Some of the procedural GD API functions can still throw `ImagickException`, which is fun.

See #36588.


git-svn-id: https://develop.svn.wordpress.org/trunk@37327 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2016-04-29 16:15:37 +00:00
parent 32dfe766e8
commit fe85e78329
1 changed files with 16 additions and 0 deletions

View File

@ -10,6 +10,22 @@ require_once( dirname( __FILE__ ) . '/base.php' );
abstract class WP_Tests_Image_Resize_UnitTestCase extends WP_Image_UnitTestCase {
public function setUp() {
parent::setUp();
add_filter( 'wp_image_editors', array( $this, 'wp_image_editors' ) );
}
public function tearDown() {
remove_filter( 'wp_image_editors', array( $this, 'wp_image_editors' ) );
parent::tearDown();
}
public function wp_image_editors() {
return array( $this->editor_engine );
}
function test_resize_jpg() {
$image = $this->resize_helper( DIR_TESTDATA.'/images/test-image.jpg', 25, 25 );