Make WordPress Core


Ignore:
Timestamp:
09/21/2020 11:34:06 AM (6 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/image/functions.php

    r49018 r49024  
    349349        }
    350350
     351        /**
     352         * @requires function imagejpeg
     353         */
    351354        public function test_wp_crop_image_file() {
    352                 if ( ! function_exists( 'imagejpeg' ) ) {
    353                         $this->fail( 'jpeg support unavailable' );
    354                 }
    355 
    356355                $file = wp_crop_image(
    357356                        DIR_TESTDATA . '/images/canola.jpg',
     
    373372        }
    374373
     374        /**
     375         * @requires function imagejpeg
     376         */
    375377        public function test_wp_crop_image_url() {
    376                 if ( ! function_exists( 'imagejpeg' ) ) {
    377                         $this->fail( 'jpeg support unavailable' );
    378                 }
    379 
    380378                if ( ! extension_loaded( 'openssl' ) ) {
    381379                        $this->markTestSkipped( 'Tests_Image_Functions::test_wp_crop_image_url() requires openssl.' );
Note: See TracChangeset for help on using the changeset viewer.