WordPress.org

Make WordPress Core

Changeset 701 in tests


Ignore:
Timestamp:
04/28/2012 08:37:20 PM (10 years ago)
Author:
maxcutler
Message:

XMLRPC: Always pass the required number of arguments to XML-RPC methods, even if they won't be used.

Related to #WP20394.

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

Legend:

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

    r548 r701  
    1717
    1818    function test_invalid_username_password() {
    19         $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'username', 'password' ) );
     19        $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'username', 'password', 'category', 0 ) );
    2020        $this->assertInstanceOf( 'IXR_Error', $result );
    2121        $this->assertEquals( 403, $result->code );
     
    2323
    2424    function test_empty_taxonomy() {
    25         $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber' ) );
     25        $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', '', 0 ) );
    2626        $this->assertInstanceOf( 'IXR_Error', $result );
    2727        $this->assertEquals( 403, $result->code );
     
    3030
    3131    function test_invalid_taxonomy() {
    32         $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', 'not_existing' ) );
     32        $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', 'not_existing', 0 ) );
    3333        $this->assertInstanceOf( 'IXR_Error', $result );
    3434        $this->assertEquals( 403, $result->code );
  • wp-testcase/test-xmlrpc-api/test_wp_editTerm.php

    r548 r701  
    2323
    2424    function test_invalid_username_password() {
    25         $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'username', 'password' ) );
     25        $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'username', 'password', 'category', 1 ) );
    2626        $this->assertInstanceOf( 'IXR_Error', $result );
    2727        $this->assertEquals( 403, $result->code );
     
    2929
    3030    function test_empty_taxonomy() {
    31         $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber' ) );
     31        $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', '', array() ) );
    3232        $this->assertInstanceOf( 'IXR_Error', $result );
    3333        $this->assertEquals( 403, $result->code );
  • wp-testcase/test-xmlrpc-api/test_wp_getPost.php

    r699 r701  
    2929
    3030    function test_invalid_username_password() {
    31         $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'username', 'password' ) );
     31        $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'username', 'password', 1 ) );
    3232        $this->assertInstanceOf( 'IXR_Error', $result );
    3333        $this->assertEquals( 403, $result->code );
  • wp-testcase/test-xmlrpc-api/test_wp_getTaxonomy.php

    r548 r701  
    44
    55    function test_invalid_username_password() {
    6         $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'username', 'password' ) );
     6        $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'username', 'password', 'category' ) );
    77        $this->assertInstanceOf( 'IXR_Error', $result );
    88        $this->assertEquals( 403, $result->code );
     
    1010
    1111    function test_empty_taxonomy() {
    12         $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'subscriber', 'subscriber' ) );
     12        $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'subscriber', 'subscriber', '' ) );
    1313        $this->assertInstanceOf( 'IXR_Error', $result );
    1414        $this->assertEquals( 403, $result->code );
  • wp-testcase/test-xmlrpc-api/test_wp_getTerm.php

    r564 r701  
    1717
    1818    function test_invalid_username_password() {
    19         $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'username', 'password' ) );
     19        $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'username', 'password', 'category', 1 ) );
    2020        $this->assertInstanceOf( 'IXR_Error', $result );
    2121        $this->assertEquals( 403, $result->code );
     
    2323
    2424    function test_empty_taxonomy() {
    25         $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'subscriber', 'subscriber' ) );
     25        $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'subscriber', 'subscriber', '', 0 ) );
    2626        $this->assertInstanceOf( 'IXR_Error', $result );
    2727        $this->assertEquals( 403, $result->code );
     
    3030
    3131    function test_invalid_taxonomy() {
    32         $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'subscriber', 'subscriber', 'not_existing' ) );
     32        $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'subscriber', 'subscriber', 'not_existing', 0 ) );
    3333        $this->assertInstanceOf( 'IXR_Error', $result );
    3434        $this->assertEquals( 403, $result->code );
  • wp-testcase/test-xmlrpc-api/test_wp_getTerms.php

    r548 r701  
    1717
    1818    function test_invalid_username_password() {
    19         $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'username', 'password' ) );
     19        $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'username', 'password', 'category' ) );
    2020        $this->assertInstanceOf( 'IXR_Error', $result );
    2121        $this->assertEquals( 403, $result->code );
     
    2323
    2424    function test_empty_taxonomy() {
    25         $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'subscriber', 'subscriber' ) );
     25        $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'subscriber', 'subscriber', '' ) );
    2626        $this->assertInstanceOf( 'IXR_Error', $result );
    2727        $this->assertEquals( 403, $result->code );
  • wp-testcase/test-xmlrpc-api/test_wp_newPost.php

    r684 r701  
    44
    55    function test_invalid_username_password() {
    6         $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'username', 'password' ) );
     6        $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'username', 'password', array() ) );
    77        $this->assertInstanceOf( 'IXR_Error', $result );
    88        $this->assertEquals( 403, $result->code );
     
    1010
    1111    function test_incapable_user() {
    12         $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'subscriber', 'subscriber' ) );
     12        $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'subscriber', 'subscriber', array() ) );
    1313        $this->assertInstanceOf( 'IXR_Error', $result );
    1414        $this->assertEquals( 401, $result->code );
     
    1616
    1717    function test_no_content() {
    18         $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author' ) );
     18        $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', array() ) );
    1919        $this->assertInstanceOf( 'IXR_Error', $result );
    2020        $this->assertEquals( 500, $result->code );
  • wp-testcase/test-xmlrpc-api/test_wp_newTerm.php

    r639 r701  
    2121
    2222    function test_invalid_username_password() {
    23         $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'username', 'password' ) );
     23        $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'username', 'password', array() ) );
    2424        $this->assertInstanceOf( 'IXR_Error', $result );
    2525        $this->assertEquals( 403, $result->code );
     
    2727
    2828    function test_empty_taxonomy() {
    29         $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'subscriber', 'subscriber' ) );
     29        $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'subscriber', 'subscriber', array() ) );
    3030        $this->assertInstanceOf( 'IXR_Error', $result );
    3131        $this->assertEquals( 403, $result->code );
Note: See TracChangeset for help on using the changeset viewer.