WordPress.org

Make WordPress Core

Changeset 637 in tests


Ignore:
Timestamp:
04/07/12 22:00:40 (2 years ago)
Author:
markoheijnen
Message:

XMLRPC: Fixed issues with mt_getRecentPostTitles when running the entire test suite

File:
1 edited

Legend:

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

    r604 r637  
    3535    } 
    3636 
     37    function test_no_posts() { 
     38        $this->_delete_all_posts(); 
     39 
     40        $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) ); 
     41        $this->assertInstanceOf( 'IXR_Error', $result ); 
     42        $this->assertEquals( 500, $result->code ); 
     43 
     44        wp_delete_post( $post_id ); 
     45    } 
     46 
    3747    function test_no_editable_posts() { 
    3848        wp_delete_post( $this->post_id ); 
     49 
     50        $post_data_editor = array( 
     51            'post_title' => rand_str(), 
     52            'post_content' => rand_str( 2000 ), 
     53            'post_excerpt' => rand_str( 100 ), 
     54            'post_author' => get_user_by( 'login', 'editor' )->ID, 
     55        ); 
     56        $post_id = wp_insert_post( $post_data_editor ); 
    3957 
    4058        $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) ); 
    4159        $this->assertNotInstanceOf( 'IXR_Error', $result ); 
    4260        $this->assertEquals( 0, count( $result ) ); 
     61 
     62        wp_delete_post( $post_id ); 
    4363    } 
    4464 
    4565    function test_date() { 
    4666        $results = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) ); 
    47         $this->assertNotInstanceOf( 'IXR_Error', $result ); 
     67        $this->assertNotInstanceOf( 'IXR_Error', $results ); 
    4868 
    4969        foreach( $results as $result ) { 
Note: See TracChangeset for help on using the changeset viewer.