WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#36588 closed defect (bug) (fixed)

Test_Image_Resize_GD::test_resize_bad_image() doesn't use GD

Reported by: ocean90 Owned by:
Milestone: 4.6 Priority: normal
Severity: normal Version:
Component: Media Keywords: needs-patch
Focuses: Cc:

Description

The test method uses WP_Tests_Image_Resize_UnitTestCase::resize_helper() which is using wp_get_image_editor() internally. wp_get_image_editor() returns the first available image editor which can be Imagick too.

In [30660] the test was changed to GD-only and moved to resize_gd.php in [31257].

Example PHPUnit output when Imagick is broken, see #36587:

$ phpunit --group media

1) Test_Image_Resize_GD::test_resize_bad_image
ImagickException: imagecreatefromstring(): Data is not in a recognized format

src/wp-includes/class-wp-image-editor-gd.php:110
src/wp-includes/media.php:2851
tests/phpunit/tests/image/resize.php:154
tests/phpunit/tests/image/resize_gd.php:32

Change History (3)

#1 @wonderboymusic
4 years ago

In 37327:

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.

#2 @wonderboymusic
4 years ago

In 37328:

Media/Unit Tests: ensure that image sizes are indeed removed when errors are raised before assertions in Tests_Media.

See #36588.

#3 @wonderboymusic
4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

#36587 addresses the error handler concerns with ImageMagick

Note: See TracTickets for help on using tickets.