WordPress.org

Make WordPress Core

Changeset 638 in tests


Ignore:
Timestamp:
04/07/2012 10:17:53 PM (6 years ago)
Author:
markoheijnen
Message:

XMLRPC: Fixed issues with wp_newTerm where wp_insert_term returned an array with the term_id

File:
1 edited

Legend:

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

    r548 r638  
    5454
    5555    function test_parent_for_nonhierarchical() {
    56         $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'post_tag', 'parent' => $this->parent_term, 'name' => 'test' ) ) );
     56        $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'post_tag', 'parent' => $this->parent_term['term_id'], 'name' => 'test' ) ) );
    5757        $this->assertInstanceOf( 'IXR_Error', $result );
    5858        $this->assertEquals( 403, $result->code );
     
    7979        $this->assertStringMatchesFormat( '%d', $result );
    8080
    81         $term_ids[] = $result;
     81        $this->term_ids[] = $result;
    8282    }
    8383
    8484    function test_add_term_with_parent() {
    85         $result  = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => $this->parent_term, 'name' => 'test' ) ) );
     85        $result  = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => $this->parent_term['term_id'], 'name' => 'test' ) ) );
    8686        $this->assertNotInstanceOf( 'IXR_Error', $result );
    8787        $this->assertStringMatchesFormat( '%d', $result );
    8888
    89         $term_ids[] = $result;
     89        $this->term_ids[] = $result;
    9090    }
    9191
    9292    function test_add_term_with_all() {
    93         $taxonomy = array( 'taxonomy' => 'category', 'parent' => $this->parent_term, 'name' => 'test_all', 'description' => 'Test all', 'slug' => 'test_all' );
     93        $taxonomy = array( 'taxonomy' => 'category', 'parent' => $this->parent_term['term_id'], 'name' => 'test_all', 'description' => 'Test all', 'slug' => 'test_all' );
    9494        $result  = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', $taxonomy ) );
    9595        $this->assertNotInstanceOf( 'IXR_Error', $result );
    9696        $this->assertStringMatchesFormat( '%d', $result );
    9797
    98         $term_ids[] = $result;
     98        $this->term_ids[] = $result;
    9999    }
    100100}
Note: See TracChangeset for help on using the changeset viewer.