Skip to content

Commit fe85e78

Browse files
committed
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
1 parent 32dfe76 commit fe85e78

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/phpunit/tests/image/resize.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@
1010

1111
abstract class WP_Tests_Image_Resize_UnitTestCase extends WP_Image_UnitTestCase {
1212

13+
public function setUp() {
14+
parent::setUp();
15+
16+
add_filter( 'wp_image_editors', array( $this, 'wp_image_editors' ) );
17+
}
18+
19+
public function tearDown() {
20+
remove_filter( 'wp_image_editors', array( $this, 'wp_image_editors' ) );
21+
22+
parent::tearDown();
23+
}
24+
25+
public function wp_image_editors() {
26+
return array( $this->editor_engine );
27+
}
28+
1329
function test_resize_jpg() {
1430
$image = $this->resize_helper( DIR_TESTDATA.'/images/test-image.jpg', 25, 25 );
1531

0 commit comments

Comments
 (0)