WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/22/2012 09:44:03 PM (10 years ago)
Author:
maxcutler
Message:

Add a base class for XMLRPC test cases.

File:
1 edited

Legend:

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

    r539 r548  
    11<?php
    2 include_once(ABSPATH . 'wp-admin/includes/admin.php');
    3 include_once(ABSPATH . WPINC . '/class-IXR.php');
    4 include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
    52
    6 class TestXMLRPCServer_wp_getTaxonomies extends WPTestCase {
    7     var $user_ids = array();
    8 
    9     function setUp() {
    10         parent::setUp();
    11         // keep track of users we create
    12         $this->user_ids = array();
    13         $this->_flush_roles();
    14 
    15         $this->orig_users = get_users_of_blog();
    16         add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
    17 
    18         $this->_make_user( 'subscriber', 'subscriber', 'subscriber' );
    19         $this->_make_user( 'contributor', 'contributor', 'contributor' );
    20         $this->_make_user( 'author', 'author', 'author' );
    21         $this->_make_user( 'editor', 'editor', 'editor' );
    22 
    23         $this->myxmlrpcserver = new wp_xmlrpc_server();
    24     }
    25 
    26     function tearDown() {
    27         parent::tearDown();
    28         // delete any users that were created during tests
    29         foreach ( $this->user_ids as $id )
    30             wp_delete_user($id);
    31 
    32         remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
    33     }
    34 
    35     function _flush_roles() {
    36         // we want to make sure we're testing against the db, not just in-memory data
    37         // this will flush everything and reload it from the db
    38         unset( $GLOBALS['wp_user_roles'] );
    39     }
     3class TestXMLRPCServer_wp_getTaxonomies extends WPXMLRPCServerTestCase {
    404
    415    function test_invalid_username_password() {
Note: See TracChangeset for help on using the changeset viewer.