Media: Consistency in logic to pass wp_getimagesize() tests.

Previously, we used `DIR_TESTDATA` to determine if a test should skip a newly silenced error in `wp_getimagesize()`.

We are now using `WP_RUN_CORE_TESTS` instead for consistency.

Props hellofromTonya, SergeyBiryukov.
See #49889.


git-svn-id: https://develop.svn.wordpress.org/trunk@50170 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Anthony Burchell
2021-02-02 21:34:40 +00:00
parent 422c2c4ad2
commit 26fb7c9682
2 changed files with 3 additions and 3 deletions

View File

@@ -721,7 +721,7 @@ function wp_read_image_metadata( $file ) {
if ( ! empty( $info['APP13'] ) ) {
if (
// Skip when running unit tests.
! defined( 'DIR_TESTDATA' )
! defined( 'WP_RUN_CORE_TESTS' )
&&
// Process without silencing errors when in debug mode.
defined( 'WP_DEBUG' ) && WP_DEBUG
@@ -792,7 +792,7 @@ function wp_read_image_metadata( $file ) {
if ( is_callable( 'exif_read_data' ) && in_array( $image_type, $exif_image_types, true ) ) {
if (
// Skip when running unit tests.
! defined( 'DIR_TESTDATA' )
! defined( 'WP_RUN_CORE_TESTS' )
&&
// Process without silencing errors when in debug mode.
defined( 'WP_DEBUG' ) && WP_DEBUG

View File

@@ -4975,7 +4975,7 @@ function wp_show_heic_upload_error( $plupload_settings ) {
function wp_getimagesize( $filename, &$imageinfo = array() ) {
if (
// Skip when running unit tests.
! defined( 'DIR_TESTDATA' )
! defined( 'WP_RUN_CORE_TESTS' )
&&
// Return without silencing errors when in debug mode.
defined( 'WP_DEBUG' ) && WP_DEBUG