WordPress.org

Make WordPress Core

Changeset 639 in tests


Ignore:
Timestamp:
04/07/12 23:02:02 (6 years ago)
Author:
markoheijnen
Message:

XMLRPC: wp_newTerm: defined the parent_term id in setUp

File:
1 edited

Legend:

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

    r638 r639  
    99        $this->term_ids = array(); 
    1010        $this->parent_term = wp_insert_term( 'parent' . rand_str(), 'category' ); 
     11        $this->parent_term = $this->parent_term['term_id']; 
    1112    } 
    1213 
     
    5455 
    5556    function test_parent_for_nonhierarchical() { 
    56         $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'post_tag', 'parent' => $this->parent_term['term_id'], 'name' => 'test' ) ) ); 
     57        $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'post_tag', 'parent' => $this->parent_term, 'name' => 'test' ) ) ); 
    5758        $this->assertInstanceOf( 'IXR_Error', $result ); 
    5859        $this->assertEquals( 403, $result->code ); 
     
    8384 
    8485    function test_add_term_with_parent() { 
    85         $result  = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => $this->parent_term['term_id'], 'name' => 'test' ) ) ); 
     86        $result  = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => $this->parent_term, 'name' => 'test' ) ) ); 
    8687        $this->assertNotInstanceOf( 'IXR_Error', $result ); 
    8788        $this->assertStringMatchesFormat( '%d', $result ); 
     
    9192 
    9293    function test_add_term_with_all() { 
    93         $taxonomy = array( 'taxonomy' => 'category', 'parent' => $this->parent_term['term_id'], 'name' => 'test_all', 'description' => 'Test all', 'slug' => 'test_all' ); 
     94        $taxonomy = array( 'taxonomy' => 'category', 'parent' => $this->parent_term, 'name' => 'test_all', 'description' => 'Test all', 'slug' => 'test_all' ); 
    9495        $result  = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', $taxonomy ) ); 
    9596        $this->assertNotInstanceOf( 'IXR_Error', $result ); 
Note: See TracChangeset for help on using the changeset viewer.