mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 14:50:29 +00:00
Tests: Convert the checks for imagejpeg() function availability to use the @requires annotation.
This better utilizes the PHPUnit native functionality. Props ayeshrajans, jrf, johnbillion. Fixes #50639. See #50640. git-svn-id: https://develop.svn.wordpress.org/trunk@49024 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -143,14 +143,11 @@ class Tests_Functions_Deprecated extends WP_UnitTestCase {
|
||||
*
|
||||
* @ticket 6821
|
||||
* @expectedDeprecated wp_save_image_file
|
||||
* @requires function imagejpeg
|
||||
*
|
||||
* @covers ::wp_save_image_file
|
||||
*/
|
||||
public function test_wp_save_image_file_deprecated_with_gd_resource() {
|
||||
if ( ! function_exists( 'imagejpeg' ) ) {
|
||||
$this->fail( 'jpeg support unavailable' );
|
||||
}
|
||||
|
||||
// Call wp_save_image_file().
|
||||
require_once ABSPATH . 'wp-admin/includes/image-edit.php';
|
||||
$file = wp_tempnam();
|
||||
@@ -168,14 +165,11 @@ class Tests_Functions_Deprecated extends WP_UnitTestCase {
|
||||
* Tests that wp_save_image_file() doesn't have a deprecated argument when passed a WP_Image_Editor.
|
||||
*
|
||||
* @ticket 6821
|
||||
* @requires function imagejpeg
|
||||
*
|
||||
* @covers ::wp_save_image_file
|
||||
*/
|
||||
public function test_wp_save_image_file_not_deprecated_with_wp_image_editor() {
|
||||
if ( ! function_exists( 'imagejpeg' ) ) {
|
||||
$this->fail( 'jpeg support unavailable' );
|
||||
}
|
||||
|
||||
// Call wp_save_image_file().
|
||||
require_once ABSPATH . 'wp-admin/includes/image-edit.php';
|
||||
$file = wp_tempnam();
|
||||
|
||||
Reference in New Issue
Block a user