Changeset 42343 for trunk/tests/phpunit/tests/image/editor.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/editor.php
r40392 r42343 5 5 /** 6 6 * Test the WP_Image_Editor base class 7 * 7 8 * @group image 8 9 * @group media … … 24 25 /** 25 26 * Test wp_get_image_editor() where load returns true 27 * 26 28 * @ticket 6821 27 29 */ … … 34 36 /** 35 37 * Test wp_get_image_editor() where load returns false 38 * 36 39 * @ticket 6821 37 40 */ … … 62 65 /** 63 66 * Test test_quality 67 * 64 68 * @ticket 6821 65 69 */ … … 68 72 // Get an editor 69 73 $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. 71 75 72 76 // Check default value … … 89 93 unset( $editor ); 90 94 $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. 92 96 93 97 // Ensure jpeg_quality filter applies if it exists before editor instantiation. … … 108 112 /** 109 113 * Test generate_filename 114 * 110 115 * @ticket 6821 111 116 */ … … 117 122 $property = new ReflectionProperty( $editor, 'size' ); 118 123 $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 ); 123 130 124 131 // Test with no parameters … … 129 136 130 137 // 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() ) ) ) ) ); 132 139 133 140 // Test with a suffix only … … 140 147 /** 141 148 * Test get_size 149 * 142 150 * @ticket 6821 143 151 */ … … 150 158 151 159 // Set a size 152 $size = array(160 $size = array( 153 161 'height' => 50, 154 'width' => 100 162 'width' => 100, 155 163 ); 156 164 $property = new ReflectionProperty( $editor, 'size' ); … … 163 171 /** 164 172 * Test get_suffix 173 * 165 174 * @ticket 6821 166 175 */ … … 172 181 173 182 // Set a size 174 $size = array(183 $size = array( 175 184 'height' => 50, 176 'width' => 100 185 'width' => 100, 177 186 ); 178 187 $property = new ReflectionProperty( $editor, 'size' );
Note: See TracChangeset
for help on using the changeset viewer.