WordPress.org

Make WordPress Core

Changeset 556 in tests


Ignore:
Timestamp:
02/29/12 01:10:44 (2 years ago)
Author:
markoheijnen
Message:

XMLRPC: Add theme support post-thumbnails when it get used in the post methods

Location:
wp-testcase/test-xmlrpc-api
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test-xmlrpc-api/test_wp_editPost.php

    r555 r556  
    8686 
    8787    function test_featured_image() { 
     88        add_theme_support( 'post-thumbnails' ); 
     89 
    8890        $author_id = get_user_by( 'login', 'author' )->ID; 
    8991        $post = array( 'post_title' => 'Featured Image Test', 'post_author' => $author_id ); 
     
    133135        $this->assertNotInstanceOf( 'IXR_Error', $result ); 
    134136        $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) ); 
     137 
     138        remove_theme_support( 'post-thumbnails' ); 
    135139    } 
    136140 
  • wp-testcase/test-xmlrpc-api/test_wp_getPost.php

    r555 r556  
    11<?php 
     2 
     3include_once(ABSPATH . WPINC . '/post-thumbnail-template.php');  
    24 
    35class TestXMLRPCServer_wp_getPost extends WPXMLRPCServerTestCase { 
     
    3335 
    3436    function test_valid_post() { 
     37        add_theme_support( 'post-thumbnails' ); 
     38 
    3539        $fields = array( 'post' ); 
    3640        $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $this->post_id, $fields ) ); 
     
    7074        $this->assertEquals( url_to_postid( $result['link'] ), $this->post_id ); 
    7175        $this->assertEquals( '', $result['featured_image'] ); 
     76 
     77        remove_theme_support( 'post-thumbnails' ); 
    7278    } 
    7379 
  • wp-testcase/test-xmlrpc-api/test_wp_newPost.php

    r555 r556  
    8282 
    8383    function test_featured_image() { 
     84        add_theme_support( 'post-thumbnails' ); 
     85 
    8486        // create attachment 
    8587        $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' ); 
     
    100102        $this->assertNotInstanceOf( 'IXR_Error', $result ); 
    101103        $this->assertEquals( $attachment_id, get_post_meta( $result, '_thumbnail_id', true ) ); 
     104 
     105        remove_theme_support( 'post-thumbnails' ); 
    102106    } 
    103107 
Note: See TracChangeset for help on using the changeset viewer.