Changeset 39189 for trunk/tests/phpunit/tests/xmlrpc/wp/getTerm.php
- Timestamp:
- 11/10/2016 01:53:08 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/getTerm.php
r38698 r39189 5 5 */ 6 6 class Tests_XMLRPC_wp_getTerm extends WP_XMLRPC_UnitTestCase { 7 var $term;8 7 9 function setUp() { 10 parent::setUp(); 8 protected static $term_id; 11 9 12 $this->term = wp_insert_term( 'term' . rand_str() , 'category' ); 13 $this->assertInternalType( 'array', $this->term ); 10 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 11 self::$term_id = $factory->term->create( array( 12 'taxonomy' => 'category', 13 ) ); 14 14 } 15 15 … … 41 41 $this->make_user_by_role( 'subscriber' ); 42 42 43 $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'subscriber', 'subscriber', 'category', $this->term['term_id']) );43 $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'subscriber', 'subscriber', 'category', self::$term_id ) ); 44 44 $this->assertInstanceOf( 'IXR_Error', $result ); 45 45 $this->assertEquals( 401, $result->code ); … … 69 69 $this->make_user_by_role( 'editor' ); 70 70 71 $term = get_term( $this->term['term_id'], 'category', ARRAY_A );71 $term = get_term( self::$term_id, 'category', ARRAY_A ); 72 72 73 $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', $this->term['term_id']) );73 $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', self::$term_id ) ); 74 74 75 75 $this->assertNotInstanceOf( 'IXR_Error', $result );
Note: See TracChangeset
for help on using the changeset viewer.