WordPress.org

Make WordPress Core

Changeset 1119 in tests


Ignore:
Timestamp:
11/07/12 22:15:17 (17 months ago)
Author:
westi
Message:

Revert [1118] - I don't think these new tests are for the correct behaviour, we need to discuss and review more

See: http://core.trac.wordpress.org/ticket/21977#comment:6

Location:
trunk/tests/xmlrpc/wp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/xmlrpc/wp/editTerm.php

    r1118 r1119  
    9393 
    9494        $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], array( 'taxonomy' => 'category', 'parent' => '', 'name' => 'test' ) ) ); 
    95         $this->assertNotInstanceOf( 'IXR_Error', $result ); 
    96         $this->assertInternalType( 'boolean', $result ); 
    97  
    98         $term = get_term( $this->child_term['term_id'], 'category' ); 
    99         $this->assertEquals( '0', $term->parent ); 
    100     } 
    101  
    102     function test_parent_null() { 
    103         $this->make_user_by_role( 'editor' ); 
    104  
    105         $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], array( 'taxonomy' => 'category', 'parent' => NULL, 'name' => 'test' ) ) ); 
    106  
    107         $this->assertNotInstanceOf( 'IXR_Error', $result ); 
    108         $this->assertInternalType( 'boolean', $result ); 
    109  
    110         $term = get_term( $this->child_term['term_id'], 'category' ); 
    111         $this->assertEquals( '0', $term->parent ); 
     95        $this->assertInstanceOf( 'IXR_Error', $result ); 
     96        $this->assertEquals( 500, $result->code ); 
     97        $this->assertEquals( __('Empty Term'), $result->message ); 
    11298    } 
    11399 
  • trunk/tests/xmlrpc/wp/newTerm.php

    r1118 r1119  
    4848    } 
    4949 
    50     function test_empty_term_name() { 
     50    function test_empty_term() { 
    5151        $this->make_user_by_role( 'editor' ); 
    5252 
     
    6464        $this->assertEquals( 403, $result->code ); 
    6565        $this->assertEquals( __( 'This taxonomy is not hierarchical.' ), $result->message ); 
    66     } 
    67  
    68     function test_parent_empty() { 
    69         $this->make_user_by_role( 'editor' ); 
    70  
    71         $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => '', 'name' => 'test' ) ) ); 
    72         $this->assertNotInstanceOf( 'IXR_Error', $result ); 
    73         $this->assertStringMatchesFormat( '%d', $result ); 
    74     } 
    75  
    76     function test_parent_null() { 
    77         $this->make_user_by_role( 'editor' ); 
    78  
    79         $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => NULL, 'name' => 'test' ) ) ); 
    80         $this->assertNotInstanceOf( 'IXR_Error', $result ); 
    81         $this->assertStringMatchesFormat( '%d', $result ); 
    8266    } 
    8367 
Note: See TracChangeset for help on using the changeset viewer.