Make WordPress Core


Ignore:
Timestamp:
09/21/2020 11:34:06 AM (5 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/post/attachments.php

    r48937 r49024  
    5555    }
    5656
     57    /**
     58     * @requires function imagejpeg
     59     */
    5760    function test_insert_image_thumb_only() {
    58         if ( ! function_exists( 'imagejpeg' ) ) {
    59             $this->fail( 'jpeg support unavailable' );
    60         }
    61 
    6261        update_option( 'medium_size_w', 0 );
    6362        update_option( 'medium_size_h', 0 );
     
    107106    }
    108107
     108    /**
     109     * @requires function imagejpeg
     110     */
    109111    function test_insert_image_medium_sizes() {
    110         if ( ! function_exists( 'imagejpeg' ) ) {
    111             $this->fail( 'jpeg support unavailable' );
    112         }
    113 
    114112        update_option( 'medium_size_w', 400 );
    115113        update_option( 'medium_size_h', 0 );
     
    165163    }
    166164
    167 
     165    /**
     166     * @requires function imagejpeg
     167     */
    168168    function test_insert_image_delete() {
    169         if ( ! function_exists( 'imagejpeg' ) ) {
    170             $this->fail( 'jpeg support unavailable' );
    171         }
    172 
    173169        update_option( 'medium_size_w', 400 );
    174170        update_option( 'medium_size_h', 0 );
Note: See TracChangeset for help on using the changeset viewer.