Changeset 37328
- Timestamp:
- 04/29/2016 05:51:54 PM (8 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/intermediate_size.php
r35348 r37328 8 8 function tearDown() { 9 9 $this->remove_added_uploads(); 10 11 remove_image_size( 'test-size' ); 12 remove_image_size( 'false-height' ); 13 remove_image_size( 'false-width' ); 14 remove_image_size( 'off-by-one' ); 10 15 parent::tearDown(); 11 16 } … … 70 75 $image = image_get_intermediate_size( $id, 'test-size' ); 71 76 72 // test for the expected string because the array will by definition73 // return with the correct height and width attributes74 $this->assertTrue( strpos( $image['file'], '330x220' ) > 0 );75 76 77 // cleanup 77 78 remove_image_size( 'test-size' ); 79 80 // test for the expected string because the array will by definition 81 // return with the correct height and width attributes 82 $this->assertTrue( strpos( $image['file'], '330x220' ) > 0 ); 78 83 } 79 84 … … 97 102 // return with the correct height and width attributes 98 103 $this->assertTrue( strpos( $image['file'], '330x220' ) > 0 ); 99 100 // cleanup101 remove_image_size( 'test-size' );102 remove_image_size( 'false-height' );103 remove_image_size( 'false-width' );104 104 } 105 105 … … 124 124 // return with the correct height and width attributes 125 125 $this->assertTrue( strpos( $image['file'], '450x300' ) > 0 ); 126 127 // cleanup128 remove_image_size( 'test-size' );129 remove_image_size( 'false-height' );130 remove_image_size( 'false-width' );131 126 } 132 127 … … 150 145 // return with the correct height and width attributes 151 146 $this->assertFalse( $image ); 152 153 // cleanup154 remove_image_size( 'false-height' );155 remove_image_size( 'false-width' );156 147 } 157 148 … … 181 172 // return with the correct height and width attributes 182 173 $this->assertTrue( strpos( $image['file'], $image_w . 'x' . $image_h ) > 0 ); 183 184 // cleanup185 remove_image_size( 'test-size' );186 remove_image_size( 'false-height' );187 174 } 188 175 … … 213 200 // return with the correct height and width attributes 214 201 $this->assertTrue( strpos( $image['file'], $image_w . 'x' . $image_h ) > 0 ); 215 216 // cleanup217 remove_image_size( 'test-size' );218 remove_image_size( 'false-height' );219 202 } 220 203 … … 241 224 242 225 $this->assertTrue( strpos( $image['file'], $width . 'x' . $height ) > 0 ); 243 244 // cleanup245 remove_image_size( 'off-by-one' );246 226 } 247 227 } -
trunk/tests/phpunit/tests/media.php
r37035 r37328 585 585 } 586 586 587 remove_image_size( 'test-size' ); 588 587 589 $this->assertArrayNotHasKey( 'test-size', $_wp_additional_image_sizes ); 588 590 add_image_size( 'test-size', 200, 600 ); 589 $this->assertArrayHasKey( 'test-size', $_wp_additional_image_sizes ); 590 $this->assertEquals( 200, $_wp_additional_image_sizes['test-size']['width'] ); 591 $this->assertEquals( 600, $_wp_additional_image_sizes['test-size']['height'] ); 591 592 $sizes = $_wp_additional_image_sizes; 592 593 593 594 // Clean up 594 595 remove_image_size( 'test-size' ); 596 597 $this->assertArrayHasKey( 'test-size', $sizes ); 598 $this->assertEquals( 200, $sizes['test-size']['width'] ); 599 $this->assertEquals( 600, $sizes['test-size']['height'] ); 595 600 } 596 601
Note: See TracChangeset
for help on using the changeset viewer.