diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php index 06b8cdb59a..0e8870f6b6 100644 --- a/tests/phpunit/tests/media.php +++ b/tests/phpunit/tests/media.php @@ -1430,7 +1430,7 @@ EOF; } /** - * Helper function to get image size array from size "name" + * Helper function to get image size array from size "name". */ function _get_image_size_array_from_meta( $image_meta, $size_name ) { $array = false; @@ -1443,6 +1443,10 @@ EOF; } } + if ( ! $array ) { + $this->fail( sprintf( "Could not retrieve image metadata for size '%s'.", $size_name ) ); + } + return $array; }