mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Move PHPUnit tests into a tests/phpunit directory.
wp-tests-config.php can/should reside in the root of a develop checkout. `phpunit` should be run from the root. see #25088. git-svn-id: https://develop.svn.wordpress.org/trunk@25165 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
30
tests/phpunit/includes/testcase-xmlrpc.php
Normal file
30
tests/phpunit/includes/testcase-xmlrpc.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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' );
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
protected function make_user_by_role( $role ) {
|
||||
return $this->factory->user->create( array(
|
||||
'user_login' => $role,
|
||||
'user_pass' => $role,
|
||||
'role' => $role
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user