2013-08-07 08:38:38 +02:00
|
|
|
<?php
|
2020-02-06 07:31:22 +01:00
|
|
|
require_once ABSPATH . 'wp-admin/includes/admin.php';
|
|
|
|
require_once ABSPATH . WPINC . '/class-IXR.php';
|
|
|
|
require_once ABSPATH . WPINC . '/class-wp-xmlrpc-server.php';
|
2013-08-07 08:38:38 +02:00
|
|
|
|
|
|
|
class WP_XMLRPC_UnitTestCase extends WP_UnitTestCase {
|
|
|
|
protected $myxmlrpcserver;
|
|
|
|
|
|
|
|
function setUp() {
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
|
|
|
|
|
2015-10-23 06:49:08 +02:00
|
|
|
$this->myxmlrpcserver = new wp_xmlrpc_server();
|
2013-08-07 08:38:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function tearDown() {
|
|
|
|
remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
|
2015-10-23 06:45:10 +02:00
|
|
|
|
2014-11-08 21:17:17 +01:00
|
|
|
$this->remove_added_uploads();
|
2013-08-07 08:38:38 +02:00
|
|
|
|
|
|
|
parent::tearDown();
|
|
|
|
}
|
|
|
|
|
2020-10-22 02:17:10 +02:00
|
|
|
protected static function make_user_by_role( $role ) {
|
2017-12-01 00:09:33 +01:00
|
|
|
return self::factory()->user->create(
|
|
|
|
array(
|
|
|
|
'user_login' => $role,
|
|
|
|
'user_pass' => $role,
|
|
|
|
'role' => $role,
|
|
|
|
)
|
|
|
|
);
|
2013-08-07 08:38:38 +02:00
|
|
|
}
|
2015-10-23 06:45:10 +02:00
|
|
|
|
2017-12-01 00:09:33 +01:00
|
|
|
}
|