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/functions/deprecated.php

    r49006 r49024  
    144144     * @ticket 6821
    145145     * @expectedDeprecated wp_save_image_file
     146     * @requires function imagejpeg
    146147     *
    147148     * @covers ::wp_save_image_file
    148149     */
    149150    public function test_wp_save_image_file_deprecated_with_gd_resource() {
    150         if ( ! function_exists( 'imagejpeg' ) ) {
    151             $this->fail( 'jpeg support unavailable' );
    152         }
    153 
    154151        // Call wp_save_image_file().
    155152        require_once ABSPATH . 'wp-admin/includes/image-edit.php';
     
    169166     *
    170167     * @ticket 6821
     168     * @requires function imagejpeg
    171169     *
    172170     * @covers ::wp_save_image_file
    173171     */
    174172    public function test_wp_save_image_file_not_deprecated_with_wp_image_editor() {
    175         if ( ! function_exists( 'imagejpeg' ) ) {
    176             $this->fail( 'jpeg support unavailable' );
    177         }
    178 
    179173        // Call wp_save_image_file().
    180174        require_once ABSPATH . 'wp-admin/includes/image-edit.php';
Note: See TracChangeset for help on using the changeset viewer.