Changeset 49014
- Timestamp:
- 09/20/2020 01:25:07 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/functions.php
r49009 r49014 156 156 } 157 157 158 if ( ! WP_Image_Editor_GD::test() && ! WP_Image_Editor_Imagick::test() ) { 158 $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' ); 159 160 foreach ( $classes as $class ) { 161 if ( ! call_user_func( array( $class, 'test' ) ) ) { 162 // If the image editor isn't available, skip it. 163 unset( $classes[ $class ] ); 164 } 165 } 166 167 if ( ! $classes ) { 159 168 $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', 'WP_Image_Editor_GD' ) ); 160 169 } … … 170 179 171 180 // Test each image editor engine. 172 $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );173 181 foreach ( $classes as $class ) { 174 175 // If the image editor isn't available, skip it.176 if ( ! call_user_func( array( $class, 'test' ) ) ) {177 continue;178 }179 180 182 $img = new $class( DIR_TESTDATA . '/images/canola.jpg' ); 181 183 $loaded = $img->load(); … … 213 215 } 214 216 215 if ( ! WP_Image_Editor_GD::test() && ! WP_Image_Editor_Imagick::test() ) { 217 $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' ); 218 219 foreach ( $classes as $class ) { 220 if ( ! call_user_func( array( $class, 'test' ) ) ) { 221 // If the image editor isn't available, skip it. 222 unset( $classes[ $class ] ); 223 } 224 } 225 226 if ( ! $classes ) { 216 227 $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', 'WP_Image_Editor_GD' ) ); 217 228 } 218 229 219 230 // Test each image editor engine. 220 $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );221 231 foreach ( $classes as $class ) { 222 223 // If the image editor isn't available, skip it.224 if ( ! call_user_func( array( $class, 'test' ) ) ) {225 continue;226 }227 228 232 $img = new $class( DIR_TESTDATA . '/images/canola.jpg' ); 229 233 $loaded = $img->load(); … … 256 260 } 257 261 258 if ( ! WP_Image_Editor_GD::test() && ! WP_Image_Editor_Imagick::test() ) { 262 $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' ); 263 264 foreach ( $classes as $class ) { 265 if ( ! call_user_func( array( $class, 'test' ) ) ) { 266 // If the image editor isn't available, skip it. 267 unset( $classes[ $class ] ); 268 } 269 } 270 271 if ( ! $classes ) { 259 272 $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', 'WP_Image_Editor_GD' ) ); 260 273 } … … 271 284 272 285 // Test each image editor engine. 273 $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );274 286 foreach ( $classes as $class ) { 275 276 // If the image editor isn't available, skip it.277 if ( ! call_user_func( array( $class, 'test' ) ) ) {278 continue;279 }280 281 287 $img = new $class( DIR_TESTDATA . '/images/canola.jpg' ); 282 288 $loaded = $img->load(); … … 320 326 $this->assertNotInternalType( 'resource', $editor2 ); 321 327 322 if ( ! WP_Image_Editor_GD::test() && ! WP_Image_Editor_Imagick::test() ) { 328 $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' ); 329 330 foreach ( $classes as $class ) { 331 if ( ! call_user_func( array( $class, 'test' ) ) ) { 332 // If the image editor isn't available, skip it. 333 unset( $classes[ $class ] ); 334 } 335 } 336 337 if ( ! $classes ) { 323 338 $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', 'WP_Image_Editor_GD' ) ); 324 339 } 325 340 326 341 // Then, test with editors. 327 $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );328 342 foreach ( $classes as $class ) { 329 // If the image editor isn't available, skip it.330 if ( ! call_user_func( array( $class, 'test' ) ) ) {331 continue;332 }333 334 343 $editor = new $class( DIR_TESTDATA ); 335 344 $loaded = $editor->load();
Note: See TracChangeset
for help on using the changeset viewer.