Changeset 52010 for trunk/tests/phpunit/tests/post/thumbnails.php
- Timestamp:
- 11/04/2021 03:22:47 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post/thumbnails.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/thumbnails.php
r51568 r52010 32 32 } 33 33 34 function test_has_post_thumbnail() {34 public function test_has_post_thumbnail() { 35 35 $this->assertFalse( has_post_thumbnail( self::$post ) ); 36 36 $this->assertFalse( has_post_thumbnail( self::$post->ID ) ); … … 54 54 } 55 55 56 function test_get_post_thumbnail_id() {56 public function test_get_post_thumbnail_id() { 57 57 $this->assertSame( 0, get_post_thumbnail_id( self::$post ) ); 58 58 $this->assertSame( 0, get_post_thumbnail_id( self::$post->ID ) ); … … 69 69 } 70 70 71 function test_update_post_thumbnail_cache() {71 public function test_update_post_thumbnail_cache() { 72 72 set_post_thumbnail( self::$post, self::$attachment_id ); 73 73 … … 90 90 * @ticket 12235 91 91 */ 92 function test_get_the_post_thumbnail_caption() {92 public function test_get_the_post_thumbnail_caption() { 93 93 $this->assertSame( '', get_the_post_thumbnail_caption() ); 94 94 … … 114 114 * @ticket 12235 115 115 */ 116 function test_get_the_post_thumbnail_caption_empty() {116 public function test_get_the_post_thumbnail_caption_empty() { 117 117 $post_id = self::factory()->post->create(); 118 118 $attachment_id = self::factory()->attachment->create_object( … … 134 134 * @ticket 12235 135 135 */ 136 function test_the_post_thumbnail_caption() {136 public function test_the_post_thumbnail_caption() { 137 137 $caption = 'This is a caption.'; 138 138 … … 154 154 } 155 155 156 function test_get_the_post_thumbnail() {156 public function test_get_the_post_thumbnail() { 157 157 $this->assertSame( '', get_the_post_thumbnail() ); 158 158 $this->assertSame( '', get_the_post_thumbnail( self::$post ) ); … … 175 175 } 176 176 177 function test_the_post_thumbnail() {177 public function test_the_post_thumbnail() { 178 178 179 179 $this->expectOutputString( '' ); … … 203 203 * @ticket 33070 204 204 */ 205 function test_get_the_post_thumbnail_url() {205 public function test_get_the_post_thumbnail_url() { 206 206 $this->assertFalse( has_post_thumbnail( self::$post ) ); 207 207 $this->assertFalse( get_the_post_thumbnail_url() ); … … 221 221 * @ticket 33070 222 222 */ 223 function test_get_the_post_thumbnail_url_with_invalid_post() {223 public function test_get_the_post_thumbnail_url_with_invalid_post() { 224 224 set_post_thumbnail( self::$post, self::$attachment_id ); 225 225 … … 235 235 * @ticket 33070 236 236 */ 237 function test_the_post_thumbnail_url() {237 public function test_the_post_thumbnail_url() { 238 238 $GLOBALS['post'] = self::$post; 239 239 … … 250 250 * @ticket 12922 251 251 */ 252 function test__wp_preview_post_thumbnail_filter() {252 public function test__wp_preview_post_thumbnail_filter() { 253 253 $old_post = isset( $GLOBALS['post'] ) ? $GLOBALS['post'] : null; 254 254 … … 270 270 * @ticket 37697 271 271 */ 272 function test__wp_preview_post_thumbnail_filter_secondary_post() {272 public function test__wp_preview_post_thumbnail_filter_secondary_post() { 273 273 $old_post = isset( $GLOBALS['post'] ) ? $GLOBALS['post'] : null; 274 274 … … 296 296 * @ticket 12922 297 297 */ 298 function test_insert_post_with_post_thumbnail() {298 public function test_insert_post_with_post_thumbnail() { 299 299 $post_id = wp_insert_post( 300 300 array( … … 327 327 * @ticket 37658 328 328 */ 329 function test_insert_attachment_with_post_thumbnail() {329 public function test_insert_attachment_with_post_thumbnail() { 330 330 // Audio files support featured images. 331 331 $post_id = wp_insert_post( … … 366 366 * @ticket 39030 367 367 */ 368 function test_post_thumbnail_size_filter_simple() {368 public function test_post_thumbnail_size_filter_simple() { 369 369 $this->current_size_filter_data = 'medium'; 370 370 … … 387 387 * @dataProvider data_post_thumbnail_size_filter_complex 388 388 */ 389 function test_post_thumbnail_size_filter_complex( $which_post, $expected ) {389 public function test_post_thumbnail_size_filter_complex( $which_post, $expected ) { 390 390 $this->current_size_filter_data = array( 391 391 self::$post->ID => 'medium', … … 409 409 } 410 410 411 function data_post_thumbnail_size_filter_complex() {411 public function data_post_thumbnail_size_filter_complex() { 412 412 return array( 413 413 array( 0, 'medium' ), … … 416 416 } 417 417 418 function filter_post_thumbnail_size( $size, $post_id ) {418 public function filter_post_thumbnail_size( $size, $post_id ) { 419 419 if ( is_array( $this->current_size_filter_data ) && isset( $this->current_size_filter_data[ $post_id ] ) ) { 420 420 return $this->current_size_filter_data[ $post_id ]; … … 428 428 } 429 429 430 function filter_set_post_thumbnail_size_result( $html, $post_id, $post_thumbnail_id, $size ) {430 public function filter_set_post_thumbnail_size_result( $html, $post_id, $post_thumbnail_id, $size ) { 431 431 $this->current_size_filter_result = $size; 432 432
Note: See TracChangeset
for help on using the changeset viewer.