WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/07/2017 01:37:39 PM (2 years ago)
Author:
johnbillion
Message:

Build/Test tools: Remove occurrences of create_function() in unit tests.

Props desrosj

See #37082

File:
1 edited

Legend:

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

    r36616 r40392  
    4747
    4848    /**
     49     * Return integer of 95 for testing.
     50     */
     51    public function return_integer_95() {
     52        return 95;
     53    }
     54
     55    /**
     56     * Return integer of 100 for testing.
     57     */
     58    public function return_integer_100() {
     59        return 100;
     60    }
     61
     62    /**
    4963     * Test test_quality
    5064     * @ticket 6821
     
    6074
    6175        // Ensure the quality filters do not have precedence if created after editor instantiation.
    62         $func_100_percent = create_function( '', "return 100;" );
     76        $func_100_percent = array( $this, 'return_integer_100' );
    6377        add_filter( 'wp_editor_set_quality', $func_100_percent );
    6478        $this->assertEquals( 82, $editor->get_quality() );
    6579
    66         $func_95_percent = create_function( '', "return 95;" );
     80        $func_95_percent = array( $this, 'return_integer_95' );
    6781        add_filter( 'jpeg_quality', $func_95_percent );
    6882        $this->assertEquals( 82, $editor->get_quality() );
Note: See TracChangeset for help on using the changeset viewer.