Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

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

    r46586 r47122  
    7070    public function test_set_quality() {
    7171
    72         // Get an editor
     72        // Get an editor.
    7373        $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
    7474        $editor->set_mime_type( 'image/jpeg' ); // Ensure mime-specific filters act properly.
    7575
    76         // Check default value
     76        // Check default value.
    7777        $this->assertEquals( 82, $editor->get_quality() );
    7878
     
    8686        $this->assertEquals( 82, $editor->get_quality() );
    8787
    88         // Ensure set_quality() works and overrides the filters
     88        // Ensure set_quality() works and overrides the filters.
    8989        $this->assertTrue( $editor->set_quality( 75 ) );
    9090        $this->assertEquals( 75, $editor->get_quality() );
    9191
    92         // Get a new editor to clear default quality state
     92        // Get a new editor to clear default quality state.
    9393        unset( $editor );
    9494        $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
     
    9898        $this->assertEquals( 95, $editor->get_quality() );
    9999
    100         // Get a new editor to clear jpeg_quality state
     100        // Get a new editor to clear jpeg_quality state.
    101101        remove_filter( 'jpeg_quality', $func_95_percent );
    102102        unset( $editor );
     
    106106        $this->assertEquals( 100, $editor->get_quality() );
    107107
    108         // Clean up
     108        // Clean up.
    109109        remove_filter( 'wp_editor_set_quality', $func_100_percent );
    110110    }
     
    117117    public function test_generate_filename() {
    118118
    119         // Get an editor
     119        // Get an editor.
    120120        $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
    121121
     
    130130        );
    131131
    132         // Test with no parameters
     132        // Test with no parameters.
    133133        $this->assertEquals( 'canola-100x50.jpg', wp_basename( $editor->generate_filename() ) );
    134134
    135         // Test with a suffix only
     135        // Test with a suffix only.
    136136        $this->assertEquals( 'canola-new.jpg', wp_basename( $editor->generate_filename( 'new' ) ) );
    137137
    138         // Test with a destination dir only
     138        // Test with a destination dir only.
    139139        $this->assertEquals( trailingslashit( realpath( get_temp_dir() ) ), trailingslashit( realpath( dirname( $editor->generate_filename( null, get_temp_dir() ) ) ) ) );
    140140
    141         // Test with a suffix only
     141        // Test with a suffix only.
    142142        $this->assertEquals( 'canola-100x50.png', wp_basename( $editor->generate_filename( null, null, 'png' ) ) );
    143143
     
    155155        $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
    156156
    157         // Size should be false by default
     157        // Size should be false by default.
    158158        $this->assertNull( $editor->get_size() );
    159159
    160         // Set a size
     160        // Set a size.
    161161        $size     = array(
    162162            'height' => 50,
     
    178178        $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
    179179
    180         // Size should be false by default
     180        // Size should be false by default.
    181181        $this->assertFalse( $editor->get_suffix() );
    182182
    183         // Set a size
     183        // Set a size.
    184184        $size     = array(
    185185            'height' => 50,
Note: See TracChangeset for help on using the changeset viewer.