From be28a2c9c53f0cea5c26aa97b5152bdfc87e3de9 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 21 Jan 2015 18:57:17 +0000 Subject: [PATCH] A few more wordpress.com https assets in unit tests. See #31091. git-svn-id: https://develop.svn.wordpress.org/trunk@31259 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/image/functions.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/image/functions.php b/tests/phpunit/tests/image/functions.php index b7a456db49..73a414637f 100644 --- a/tests/phpunit/tests/image/functions.php +++ b/tests/phpunit/tests/image/functions.php @@ -292,7 +292,11 @@ class Tests_Image_Functions extends WP_UnitTestCase { if ( !function_exists( 'imagejpeg' ) ) $this->markTestSkipped( 'jpeg support unavailable' ); - $file = wp_crop_image( 'http://asdftestblog1.files.wordpress.com/2008/04/canola.jpg', + if ( ! extension_loaded( 'openssl' ) ) { + $this->markTestSkipped( 'Tests_Image_Functions::test_wp_crop_image_url() requires openssl.' ); + } + + $file = wp_crop_image( 'https://asdftestblog1.files.wordpress.com/2008/04/canola.jpg', 0, 0, 100, 100, 100, 100, false, DIR_TESTDATA . '/images/' . rand_str() . '.jpg' ); $this->assertNotInstanceOf( 'WP_Error', $file ); @@ -312,7 +316,11 @@ class Tests_Image_Functions extends WP_UnitTestCase { } public function test_wp_crop_image_url_not_exist() { - $file = wp_crop_image( 'http://asdftestblog1.files.wordpress.com/2008/04/canoladoesnotexist.jpg', + if ( ! extension_loaded( 'openssl' ) ) { + $this->markTestSkipped( 'Tests_Image_Functions::test_wp_crop_image_url_not_exist() requires openssl.' ); + } + + $file = wp_crop_image( 'https://asdftestblog1.files.wordpress.com/2008/04/canoladoesnotexist.jpg', 0, 0, 100, 100, 100, 100 ); $this->assertInstanceOf( 'WP_Error', $file ); }