Make WordPress Core

Changeset 1118 in tests for trunk/tests/xmlrpc/wp/editTerm.php


Ignore:
Timestamp:
11/07/2012 09:21:54 PM (13 years ago)
Author:
nacin
Message:

XML-RPC editTerm/newTerm parent empty tests. props markoheijnen, see #WP21977.

File:
1 edited

Legend:

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

    r922 r1118  
    9393
    9494        $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], array( 'taxonomy' => 'category', 'parent' => '', 'name' => 'test' ) ) );
    95         $this->assertInstanceOf( 'IXR_Error', $result );
    96         $this->assertEquals( 500, $result->code );
    97         $this->assertEquals( __('Empty Term'), $result->message );
     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 );
    98112    }
    99113
Note: See TracChangeset for help on using the changeset viewer.