Changeset 52010 for trunk/tests/phpunit/tests/image/size.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/size.php
r47122 r52010 8 8 class Tests_Image_Size extends WP_UnitTestCase { 9 9 10 function test_constrain_dims_zero() {10 public function test_constrain_dims_zero() { 11 11 // No constraint - should have no effect. 12 12 $out = wp_constrain_dimensions( 640, 480, 0, 0 ); … … 23 23 } 24 24 25 function test_constrain_dims_smaller() {25 public function test_constrain_dims_smaller() { 26 26 // Image size is smaller than the constraint - no effect. 27 27 $out = wp_constrain_dimensions( 500, 600, 1024, 768 ); … … 35 35 } 36 36 37 function test_constrain_dims_equal() {37 public function test_constrain_dims_equal() { 38 38 // Image size is equal to the constraint - no effect. 39 39 $out = wp_constrain_dimensions( 1024, 768, 1024, 768 ); … … 47 47 } 48 48 49 function test_constrain_dims_larger() {49 public function test_constrain_dims_larger() { 50 50 // Image size is larger than the constraint - result should be constrained. 51 51 $out = wp_constrain_dimensions( 1024, 768, 500, 600 ); … … 69 69 } 70 70 71 function test_constrain_dims_boundary() {71 public function test_constrain_dims_boundary() { 72 72 // One dimension is larger than the constraint, one smaller - result should be constrained. 73 73 $out = wp_constrain_dimensions( 1024, 768, 500, 800 ); … … 88 88 * @expectedDeprecated wp_shrink_dimensions 89 89 */ 90 function test_shrink_dimensions_default() {90 public function test_shrink_dimensions_default() { 91 91 $out = wp_shrink_dimensions( 640, 480 ); 92 92 $this->assertSame( array( 128, 96 ), $out ); … … 99 99 * @expectedDeprecated wp_shrink_dimensions 100 100 */ 101 function test_shrink_dimensions_smaller() {101 public function test_shrink_dimensions_smaller() { 102 102 // Image size is smaller than the constraint - no effect. 103 103 $out = wp_shrink_dimensions( 500, 600, 1024, 768 ); … … 111 111 * @expectedDeprecated wp_shrink_dimensions 112 112 */ 113 function test_shrink_dimensions_equal() {113 public function test_shrink_dimensions_equal() { 114 114 // Image size is equal to the constraint - no effect. 115 115 $out = wp_shrink_dimensions( 500, 600, 500, 600 ); … … 123 123 * @expectedDeprecated wp_shrink_dimensions 124 124 */ 125 function test_shrink_dimensions_larger() {125 public function test_shrink_dimensions_larger() { 126 126 // Image size is larger than the constraint - result should be constrained. 127 127 $out = wp_shrink_dimensions( 1024, 768, 500, 600 ); … … 135 135 * @expectedDeprecated wp_shrink_dimensions 136 136 */ 137 function test_shrink_dimensions_boundary() {137 public function test_shrink_dimensions_boundary() { 138 138 // One dimension is larger than the constraint, one smaller - result should be constrained. 139 139 $out = wp_shrink_dimensions( 1024, 768, 500, 800 ); … … 151 151 } 152 152 153 function test_constrain_size_for_editor_thumb() {153 public function test_constrain_size_for_editor_thumb() { 154 154 $out = image_constrain_size_for_editor( 600, 400, 'thumb' ); 155 155 $this->assertSame( array( 150, 100 ), $out ); … … 159 159 } 160 160 161 function test_constrain_size_for_editor_medium() {161 public function test_constrain_size_for_editor_medium() { 162 162 // Default max width is 500, no constraint on height. 163 163 global $content_width; … … 186 186 } 187 187 188 function test_constrain_size_for_editor_full() {188 public function test_constrain_size_for_editor_full() { 189 189 global $content_width; 190 190
Note: See TracChangeset
for help on using the changeset viewer.