WordPress.org

Make WordPress Core

Ticket #20409: 20409_unittests.2.patch

File 20409_unittests.2.patch, 3.2 KB (added by maxcutler, 3 years ago)
  • wp-testcase/test-xmlrpc-api/test_mw_getPost.php

     
    8888                $this->assertEquals( url_to_postid( $result['link'] ), $this->post_id ); 
    8989 
    9090                $this->assertEquals( '', $result['wp_post_thumbnail'] ); 
    91                 $this->assertEquals( '', $result['wp_post_thumbnail_url'] ); 
    9291 
    9392                remove_theme_support( 'post-thumbnails' ); 
    9493        } 
     
    120119                $this->assertStringMatchesFormat( '%d', $result['wp_post_thumbnail'] ); 
    121120                $this->assertEquals( $attachment_id, $result['wp_post_thumbnail'] ); 
    122121 
    123                 $this->assertInternalType( 'string', $result['wp_post_thumbnail_url'] ); 
    124                 $this->assertEquals( wp_get_attachment_url( $attachment_id ), $result['wp_post_thumbnail_url'] ); 
    125  
    126122                delete_post_thumbnail( $this->post_id ); 
    127123                remove_theme_support( 'post-thumbnails' ); 
    128124        } 
  • wp-testcase/test-xmlrpc-api/test_mw_getRecentPosts.php

     
    8484                        $this->assertEquals( url_to_postid( $result['link'] ), $post->ID ); 
    8585 
    8686                        $this->assertEquals( '', $result['wp_post_thumbnail'] ); 
    87                         $this->assertEquals( '', $result['wp_post_thumbnail_url'] ); 
    8887                } 
    8988 
    9089                remove_theme_support( 'post-thumbnails' ); 
     
    114113                foreach( $results as $result ) { 
    115114                        $this->assertInternalType( 'string', $result['wp_post_thumbnail'] ); 
    116115                        $this->assertStringMatchesFormat( '%d', $result['wp_post_thumbnail'] ); 
    117                         $this->assertInternalType( 'string', $result['wp_post_thumbnail_url'] ); 
    118116 
    119117                        if( ! empty( $result['wp_post_thumbnail'] ) || $result['postid'] == $this->post_id ) { 
    120118                                $attachment_id = get_post_meta( $result['postid'], '_thumbnail_id', true ); 
    121119 
    122120                                $this->assertEquals( $attachment_id, $result['wp_post_thumbnail'] ); 
    123                                 $this->assertEquals( wp_get_attachment_url( $attachment_id ), $result['wp_post_thumbnail_url'] ); 
    124121                        } 
    125122                } 
    126123 
  • wp-testcase/test-xmlrpc-api/test_wp_getPost.php

     
    5959                $this->assertInternalType( 'string', $result['ping_status'] ); 
    6060                $this->assertInternalType( 'bool', $result['sticky'] ); 
    6161                $this->assertInternalType( 'string', $result['post_format'] ); 
    62                 $this->assertInternalType( 'string', $result['post_thumbnail'] ); 
     62                $this->assertInternalType( 'array', $result['post_thumbnail'] ); 
    6363 
    6464                // Check expected values 
    6565                $this->assertStringMatchesFormat( '%d', $result['post_id'] ); 
     
    7070                $this->assertEquals( $this->post_data['post_excerpt'], $result['post_excerpt'] ); 
    7171                $this->assertEquals( $this->post_data['post_content'], $result['post_content'] ); 
    7272                $this->assertEquals( url_to_postid( $result['link'] ), $this->post_id ); 
    73                 $this->assertEquals( '', $result['post_thumbnail'] ); 
    7473 
    7574                remove_theme_support( 'post-thumbnails' ); 
    7675        }