WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/04/2014 01:11:38 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Fix setting default quality in WP_Image_Editor.

props markoheijnen.
fixes #29856 for trunk.

File:
1 edited

Legend:

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

    r28879 r29834  
    5353        $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
    5454
     55        // Check default value
     56        $this->assertEquals( 90, $editor->get_quality() );
     57
    5558        // Ensure set_quality works
    5659        $this->assertTrue( $editor->set_quality( 75 ) );
     
    6063        $func = create_function( '', "return 100;");
    6164        add_filter( 'wp_editor_set_quality', $func );
    62         $this->assertTrue( $editor->set_quality( 75 ) );
    63         $this->assertEquals( 75, $editor->get_quality() );
     65        $this->assertTrue( $editor->set_quality( 70 ) );
     66        $this->assertEquals( 70, $editor->get_quality() );
    6467
    6568        // Clean up
Note: See TracChangeset for help on using the changeset viewer.