WordPress.org

Make WordPress Core

Changeset 707 in tests


Ignore:
Timestamp:
05/01/12 21:03:03 (2 years ago)
Author:
nacin
Message:

Pass the correct type and number arguments to various XML-RPC methods to ensure no notices are generated.

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

Legend:

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

    r684 r707  
    44 
    55    function test_invalid_username_password() { 
    6         $result = $this->myxmlrpcserver->mw_editPost( array( 1, 'username', 'password' ) ); 
     6        $post = array(); 
     7        $result = $this->myxmlrpcserver->mw_editPost( array( 1, 'username', 'password', $post ) ); 
    78        $this->assertInstanceOf( 'IXR_Error', $result ); 
    89        $this->assertEquals( 403, $result->code ); 
  • wp-testcase/test-xmlrpc-api/test_mw_newPost.php

    r684 r707  
    44 
    55    function test_invalid_username_password() { 
    6         $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'username', 'password' ) ); 
     6        $post = array(); 
     7        $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'username', 'password', $post ) ); 
    78        $this->assertInstanceOf( 'IXR_Error', $result ); 
    89        $this->assertEquals( 403, $result->code ); 
     
    1011 
    1112    function test_incapable_user() { 
    12         $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'subscriber', 'subscriber' ) ); 
     13        $post = array(); 
     14        $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'subscriber', 'subscriber', $post ) ); 
    1315        $this->assertInstanceOf( 'IXR_Error', $result ); 
    1416        $this->assertEquals( 401, $result->code ); 
     
    1618 
    1719    function test_no_content() { 
    18         $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author' ) ); 
     20        $post = array(); 
     21        $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 
    1922        $this->assertInstanceOf( 'IXR_Error', $result ); 
    2023        $this->assertEquals( 500, $result->code ); 
  • wp-testcase/test-xmlrpc-api/test_wp_editTerm.php

    r701 r707  
    2929 
    3030    function test_empty_taxonomy() { 
    31         $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', '', array() ) ); 
     31        $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', '', array( 'taxonomy' => '' ) ) ); 
    3232        $this->assertInstanceOf( 'IXR_Error', $result ); 
    3333        $this->assertEquals( 403, $result->code ); 
  • wp-testcase/test-xmlrpc-api/test_wp_getMediaItem.php

    r693 r707  
    4646 
    4747    function test_invalid_username_password() { 
    48         $result = $this->myxmlrpcserver->wp_getMediaItem( array( 1, 'username', 'password' ) ); 
     48        $result = $this->myxmlrpcserver->wp_getMediaItem( array( 1, 'username', 'password', 0 ) ); 
    4949        $this->assertInstanceOf( 'IXR_Error', $result ); 
    5050        $this->assertEquals( 403, $result->code ); 
  • wp-testcase/test-xmlrpc-api/test_wp_newTerm.php

    r701 r707  
    2727 
    2828    function test_empty_taxonomy() { 
    29         $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'subscriber', 'subscriber', array() ) ); 
     29        $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'subscriber', 'subscriber', array( 'taxonomy' => '' ) ) ); 
    3030        $this->assertInstanceOf( 'IXR_Error', $result ); 
    3131        $this->assertEquals( 403, $result->code ); 
Note: See TracChangeset for help on using the changeset viewer.