mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 23:58:03 +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:
@@ -348,11 +348,10 @@ class Tests_Image_Functions extends WP_UnitTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires function imagejpeg
|
||||
*/
|
||||
public function test_wp_crop_image_file() {
|
||||
if ( ! function_exists( 'imagejpeg' ) ) {
|
||||
$this->fail( 'jpeg support unavailable' );
|
||||
}
|
||||
|
||||
$file = wp_crop_image(
|
||||
DIR_TESTDATA . '/images/canola.jpg',
|
||||
0,
|
||||
@@ -372,11 +371,10 @@ class Tests_Image_Functions extends WP_UnitTestCase {
|
||||
unlink( $file );
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires function imagejpeg
|
||||
*/
|
||||
public function test_wp_crop_image_url() {
|
||||
if ( ! function_exists( 'imagejpeg' ) ) {
|
||||
$this->fail( 'jpeg support unavailable' );
|
||||
}
|
||||
|
||||
if ( ! extension_loaded( 'openssl' ) ) {
|
||||
$this->markTestSkipped( 'Tests_Image_Functions::test_wp_crop_image_url() requires openssl.' );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user