diff options
author | Andrew Nacin <nacin@git.wordpress.org> | 2013-08-29 18:39:34 +0000 |
---|---|---|
committer | Andrew Nacin <nacin@git.wordpress.org> | 2013-08-29 18:39:34 +0000 |
commit | 8045afd81b7c80f6ef5b327c115a5bbb43e4b65c (patch) | |
tree | 15d457007610c451577debda89bd9e9cd3d74551 /tests/phpunit/includes/testcase-xmlrpc.php | |
parent | d34baebc1d8111c9c1014e11001957face778e52 (diff) | |
download | wordpress-8045afd81b7c80f6ef5b327c115a5bbb43e4b65c.tar.gz wordpress-8045afd81b7c80f6ef5b327c115a5bbb43e4b65c.zip |
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
Diffstat (limited to 'tests/phpunit/includes/testcase-xmlrpc.php')
-rw-r--r-- | tests/phpunit/includes/testcase-xmlrpc.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/phpunit/includes/testcase-xmlrpc.php b/tests/phpunit/includes/testcase-xmlrpc.php new file mode 100644 index 0000000000..e82c5e134e --- /dev/null +++ b/tests/phpunit/includes/testcase-xmlrpc.php @@ -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 + )); + } +} |