Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (7 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

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

    r40392 r42343  
    55/**
    66 * Test the WP_Image_Editor base class
     7 *
    78 * @group image
    89 * @group media
     
    2425    /**
    2526     * Test wp_get_image_editor() where load returns true
     27     *
    2628     * @ticket 6821
    2729     */
     
    3436    /**
    3537     * Test wp_get_image_editor() where load returns false
     38     *
    3639     * @ticket 6821
    3740     */
     
    6265    /**
    6366     * Test test_quality
     67     *
    6468     * @ticket 6821
    6569     */
     
    6872        // Get an editor
    6973        $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
    70         $editor->set_mime_type( "image/jpeg" ); // Ensure mime-specific filters act properly.
     74        $editor->set_mime_type( 'image/jpeg' ); // Ensure mime-specific filters act properly.
    7175
    7276        // Check default value
     
    8993        unset( $editor );
    9094        $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
    91         $editor->set_mime_type( "image/jpeg" ); // Ensure mime-specific filters act properly.
     95        $editor->set_mime_type( 'image/jpeg' ); // Ensure mime-specific filters act properly.
    9296
    9397        // Ensure jpeg_quality filter applies if it exists before editor instantiation.
     
    108112    /**
    109113     * Test generate_filename
     114     *
    110115     * @ticket 6821
    111116     */
     
    117122        $property = new ReflectionProperty( $editor, 'size' );
    118123        $property->setAccessible( true );
    119         $property->setValue( $editor, array(
    120             'height' => 50,
    121             'width'  => 100
    122         ));
     124        $property->setValue(
     125            $editor, array(
     126                'height' => 50,
     127                'width'  => 100,
     128            )
     129        );
    123130
    124131        // Test with no parameters
     
    129136
    130137        // Test with a destination dir only
    131         $this->assertEquals(trailingslashit( realpath( get_temp_dir() ) ), trailingslashit( realpath( dirname( $editor->generate_filename( null, get_temp_dir() ) ) ) ) );
     138        $this->assertEquals( trailingslashit( realpath( get_temp_dir() ) ), trailingslashit( realpath( dirname( $editor->generate_filename( null, get_temp_dir() ) ) ) ) );
    132139
    133140        // Test with a suffix only
     
    140147    /**
    141148     * Test get_size
     149     *
    142150     * @ticket 6821
    143151     */
     
    150158
    151159        // Set a size
    152         $size = array(
     160        $size     = array(
    153161            'height' => 50,
    154             'width'  => 100
     162            'width'  => 100,
    155163        );
    156164        $property = new ReflectionProperty( $editor, 'size' );
     
    163171    /**
    164172     * Test get_suffix
     173     *
    165174     * @ticket 6821
    166175     */
     
    172181
    173182        // Set a size
    174         $size = array(
     183        $size     = array(
    175184            'height' => 50,
    176             'width'  => 100
     185            'width'  => 100,
    177186        );
    178187        $property = new ReflectionProperty( $editor, 'size' );
Note: See TracChangeset for help on using the changeset viewer.