testcase-xmlrpc.php 712 B

123456789101112131415161718192021222324252627282930
  1. <?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');
  5. class WP_XMLRPC_UnitTestCase extends WP_UnitTestCase {
  6. protected $myxmlrpcserver;
  7. function setUp() {
  8. parent::setUp();
  9. add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
  10. $this->myxmlrpcserver = new wp_xmlrpc_server();
  11. }
  12. function tearDown() {
  13. remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
  14. parent::tearDown();
  15. }
  16. protected function make_user_by_role( $role ) {
  17. return $this->factory->user->create( array(
  18. 'user_login' => $role,
  19. 'user_pass' => $role,
  20. 'role' => $role
  21. ));
  22. }
  23. }