WordPress.org

Make WordPress Core

Changeset 706 in tests


Ignore:
Timestamp:
05/01/12 20:47:16 (2 years ago)
Author:
nacin
Message:

Basic tests for XML-RPC's _prepare_taxonomy().

File:
1 edited

Legend:

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

    r701 r706  
    3434        $this->assertNotInstanceOf( 'IXR_Error', $result ); 
    3535    } 
     36 
     37    function test_prepare_taxonomy() { 
     38        $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'category' ) ); 
     39        $taxonomy = get_taxonomy( 'category' ); 
     40        $this->assertEquals( 'category', $result['name'], 'name' ); 
     41        $this->assertEquals( true, $result['_builtin'], '_builtin' ); 
     42        $this->assertEquals( $taxonomy->show_ui, $result['show_ui'], 'show_ui' ); 
     43        $this->assertEquals( $taxonomy->public, $result['public'], 'public' ); 
     44        $this->assertEquals( $taxonomy->hierarchical, $result['hierarchical'], 'hierarchical' ); 
     45        $this->assertEquals( (array) $taxonomy->labels, $result['labels'], 'labels' ); 
     46        $this->assertEquals( (array) $taxonomy->cap, $result['cap'], 'capabilities' ); 
     47        $this->assertEquals( (array) $taxonomy->object_type, $result['object_type'], 'object_types' ); 
     48    } 
    3649} 
Note: See TracChangeset for help on using the changeset viewer.