Wordpress/tests/phpunit/includes/testcase-xmlrpc.php
Gary Pendergast 8f95800d52 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-30 23:09:33 +00:00

36 lines
765 B
PHP

<?php
include_once( ABSPATH . 'wp-admin/includes/admin.php' );
include_once( ABSPATH . WPINC . '/class-IXR.php' );
include_once( ABSPATH . WPINC . '/class-wp-xmlrpc-server.php' );
class WP_XMLRPC_UnitTestCase extends WP_UnitTestCase {
protected $myxmlrpcserver;
function setUp() {
parent::setUp();
add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
$this->myxmlrpcserver = new wp_xmlrpc_server();
}
function tearDown() {
remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
$this->remove_added_uploads();
parent::tearDown();
}
protected function make_user_by_role( $role ) {
return self::factory()->user->create(
array(
'user_login' => $role,
'user_pass' => $role,
'role' => $role,
)
);
}
}