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