WordPress.org

Make WordPress Core

Changeset 1161 in tests


Ignore:
Timestamp:
11/30/2012 07:09:18 PM (5 years ago)
Author:
convissor
Message:

Prevent failures/fatals when jpeg support missing.

Location:
trunk/tests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/functions/deprecated.php

    r1155 r1161  
    139139     */
    140140    public function test_wp_save_image_file_deprecated_with_gd_resource() {
     141        if ( !function_exists( 'imagejpeg' ) )
     142            $this->markTestSkipped( 'jpeg support unavailable' );
    141143
    142144        // Call wp_save_image_file
     
    158160     */
    159161    public function test_wp_save_image_file_not_deprecated_with_wp_image_editor() {
     162        if ( !function_exists( 'imagejpeg' ) )
     163            $this->markTestSkipped( 'jpeg support unavailable' );
    160164
    161165        // Call wp_save_image_file
  • trunk/tests/image/functions.php

    r1157 r1161  
    256256
    257257    public function test_wp_crop_image_file() {
     258        if ( !function_exists( 'imagejpeg' ) )
     259            $this->markTestSkipped( 'jpeg support unavailable' );
     260
    258261        $file = wp_crop_image( DIR_TESTDATA . '/images/canola.jpg',
    259262                              0, 0, 100, 100, 100, 100 );
     
    267270
    268271    public function test_wp_crop_image_url() {
     272        if ( !function_exists( 'imagejpeg' ) )
     273            $this->markTestSkipped( 'jpeg support unavailable' );
     274
    269275        $file = wp_crop_image( 'http://asdftestblog1.files.wordpress.com/2008/04/canola.jpg',
    270276                              0, 0, 100, 100, 100, 100, false,
  • trunk/tests/image/intermediate_size.php

    r1123 r1161  
    1414
    1515    function test_make_intermediate_size_width() {
     16        if ( !function_exists( 'imagejpeg' ) )
     17            $this->markTestSkipped( 'jpeg support unavailable' );
     18
    1619        $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 100, 0, false );
    1720
     
    2023
    2124    function test_make_intermediate_size_height() {
     25        if ( !function_exists( 'imagejpeg' ) )
     26            $this->markTestSkipped( 'jpeg support unavailable' );
     27
    2228        $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 0, 75, false );
    2329
     
    2632
    2733    function test_make_intermediate_size_successful() {
     34        if ( !function_exists( 'imagejpeg' ) )
     35            $this->markTestSkipped( 'jpeg support unavailable' );
     36
    2837        $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 100, 75, true );
    2938
  • trunk/tests/post/attachments.php

    r909 r1161  
    8484
    8585    function test_insert_image_thumb_only() {
     86        if ( !function_exists( 'imagejpeg' ) )
     87            $this->markTestSkipped( 'jpeg support unavailable' );
     88
    8689        update_option( 'medium_size_w', 0 );
    8790        update_option( 'medium_size_h', 0 );
     
    127130
    128131    function test_insert_image_medium() {
     132        if ( !function_exists( 'imagejpeg' ) )
     133            $this->markTestSkipped( 'jpeg support unavailable' );
     134
    129135        update_option('medium_size_w', 400);
    130136        update_option('medium_size_h', 0);
     
    170176
    171177    function test_insert_image_delete() {
     178        if ( !function_exists( 'imagejpeg' ) )
     179            $this->markTestSkipped( 'jpeg support unavailable' );
     180
    172181        update_option('medium_size_w', 400);
    173182        update_option('medium_size_h', 0);
Note: See TracChangeset for help on using the changeset viewer.