<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[40417] trunk/tests/phpunit: Build/Test tools: Introduce and implement `assertNotIXRError()` and `assertIXRError()` assertion methods.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/40417">40417</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/40417","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>johnbillion</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2017-04-12 14:58:33 +0000 (Wed, 12 Apr 2017)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Build/Test tools: Introduce and implement `assertNotIXRError()` and `assertIXRError()` assertion methods.
This aids in debugging XMLRPC tests which fail, by exposing the `IXR_Error` error message in the assertion failure message.
Fixes <a href="https://core.trac.wordpress.org/ticket/40423">#40423</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktestsphpunitincludestestcasephp">trunk/tests/phpunit/includes/testcase.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcbasicphp">trunk/tests/phpunit/tests/xmlrpc/basic.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcmtgetRecentPostTitlesphp">trunk/tests/phpunit/tests/xmlrpc/mt/getRecentPostTitles.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcmweditPostphp">trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcmwgetPostphp">trunk/tests/phpunit/tests/xmlrpc/mw/getPost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcmwgetRecentPostsphp">trunk/tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcmwnewPostphp">trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpdeletePostphp">trunk/tests/phpunit/tests/xmlrpc/wp/deletePost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpdeleteTermphp">trunk/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpeditCommentphp">trunk/tests/phpunit/tests/xmlrpc/wp/editComment.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpeditPostphp">trunk/tests/phpunit/tests/xmlrpc/wp/editPost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpeditProfilephp">trunk/tests/phpunit/tests/xmlrpc/wp/editProfile.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpeditTermphp">trunk/tests/phpunit/tests/xmlrpc/wp/editTerm.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetCommentphp">trunk/tests/phpunit/tests/xmlrpc/wp/getComment.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetCommentsphp">trunk/tests/phpunit/tests/xmlrpc/wp/getComments.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetMediaItemphp">trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetOptionsphp">trunk/tests/phpunit/tests/xmlrpc/wp/getOptions.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPagephp">trunk/tests/phpunit/tests/xmlrpc/wp/getPage.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPageListphp">trunk/tests/phpunit/tests/xmlrpc/wp/getPageList.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPagesphp">trunk/tests/phpunit/tests/xmlrpc/wp/getPages.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPostphp">trunk/tests/phpunit/tests/xmlrpc/wp/getPost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPostTypephp">trunk/tests/phpunit/tests/xmlrpc/wp/getPostType.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPostTypesphp">trunk/tests/phpunit/tests/xmlrpc/wp/getPostTypes.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPostsphp">trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetProfilephp">trunk/tests/phpunit/tests/xmlrpc/wp/getProfile.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetRevisionsphp">trunk/tests/phpunit/tests/xmlrpc/wp/getRevisions.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetTaxonomiesphp">trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomies.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetTaxonomyphp">trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetTermphp">trunk/tests/phpunit/tests/xmlrpc/wp/getTerm.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetTermsphp">trunk/tests/phpunit/tests/xmlrpc/wp/getTerms.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetUserphp">trunk/tests/phpunit/tests/xmlrpc/wp/getUser.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetUsersphp">trunk/tests/phpunit/tests/xmlrpc/wp/getUsers.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpnewCommentphp">trunk/tests/phpunit/tests/xmlrpc/wp/newComment.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpnewPostphp">trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpnewTermphp">trunk/tests/phpunit/tests/xmlrpc/wp/newTerm.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwprestoreRevisionphp">trunk/tests/phpunit/tests/xmlrpc/wp/restoreRevision.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpuploadFilephp">trunk/tests/phpunit/tests/xmlrpc/wp/uploadFile.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsphpunitincludestestcasephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/includes/testcase.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/includes/testcase.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/includes/testcase.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -438,6 +438,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotInstanceOf( 'WP_Error', $actual, $message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function assertIXRError( $actual, $message = '' ) {
+ $this->assertInstanceOf( 'IXR_Error', $actual, $message );
+ }
+
+ function assertNotIXRError( $actual, $message = '' ) {
+ if ( $actual instanceof IXR_Error && '' === $message ) {
+ $message = $actual->message;
+ }
+ $this->assertNotInstanceOf( 'IXR_Error', $actual, $message );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> function assertEqualFields( $object, $fields ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach( $fields as $field_name => $field_value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $object->$field_name != $field_value ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcbasicphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/basic.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/basic.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/basic.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,7 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_enabled() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'username', 'password' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> // If disabled, 405 would result.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcmtgetRecentPostTitlesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/mt/getRecentPostTitles.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/mt/getRecentPostTitles.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/mt/getRecentPostTitles.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'username', 'password' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,7 +15,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'author' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 500, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::factory()->post->create( array( 'post_author' => $editor ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, count( $result ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,7 +35,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach( $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $result['postid'] );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcmweditPostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( 1, 'username', 'password', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_title = 'Post test (updated)';
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'title' => $new_title );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue($result);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,7 +37,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_title = 'Post test (updated)';
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'title' => $new_title );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue($result);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,7 +55,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_title = 'Post test (updated)';
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'title' => $new_title );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'wp_author_id' => $author_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue($result);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,7 +88,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'wp_author_id' => $author_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,7 +107,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'wp_author_id' => $editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue($result);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -131,13 +131,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // add post thumbnail to post that does not have one
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'wp_post_thumbnail' => $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // edit the post without supplying a post_thumbnail and check that it didn't change
</span><span class="cx" style="display: block; padding: 0 10px"> $post3 = array( 'post_content' => 'Updated post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post3 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // create another attachment
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,13 +146,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // change the post's post_thumbnail
</span><span class="cx" style="display: block; padding: 0 10px"> $post4 = array( 'wp_post_thumbnail' => $attachment2_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post4 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $attachment2_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // unset the post's post_thumbnail
</span><span class="cx" style="display: block; padding: 0 10px"> $post5 = array( 'wp_post_thumbnail' => '' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array($post_id, 'author', 'author', $post5 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_support( 'post-thumbnails' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -166,7 +166,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'title' => 'New Title', 'post_author' => $contributor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue($result);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -174,7 +174,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post3 = array( 'description' => 'New Content', 'post_author' => $contributor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post3 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue($result);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -183,7 +183,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post4 = array( 'mt_excerpt' => 'New Excerpt', 'post_author' => $contributor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post4 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue($result);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,7 +202,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = wp_insert_post( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', array( 'sticky' => '1' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -215,7 +215,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'post_type' => 'page' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $result->code, 401 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcmwgetPostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/mw/getPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/mw/getPost.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/mw/getPost.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,7 +19,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getPost( array( self::$post_id, 'username', 'password' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getPost( array( self::$post_id, 'subscriber', 'subscriber' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_postid() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getPost( array( 9999, 'author', 'author' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 404, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array( 'post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getPost( array( self::$post_id, 'author', 'author' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check data types
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['userid'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,7 +96,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array( 'post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getPost( array( self::$post_id, 'author', 'author' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['wp_post_thumbnail'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result['wp_post_thumbnail'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,7 +108,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_date() {
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array( 'post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getPost( array( self::$post_id, 'author', 'author' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result['dateCreated'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result['date_created_gmt'] );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcmwgetRecentPostsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'username', 'password' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'subscriber', 'subscriber' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( self::$post_id, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'author', 'author' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, count( $result ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,7 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array( 'post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'author', 'author' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach( $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $result['postid'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,7 +99,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> set_post_thumbnail( self::$post_id, $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->mw_getRecentPosts( array( self::$post_id, 'author', 'author' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach( $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['wp_post_thumbnail'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,7 +119,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'editor', 'editor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach( $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $result['postid'] );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcmwnewPostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'username', 'password', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'subscriber', 'subscriber', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,7 +26,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 500, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'Content, title, and excerpt are empty.', $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'title' => 'Test' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'title' => 'Test', 'ID' => 103948 );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( '103948', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,7 +54,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'title' => 'Test', 'post_status' => 'publish' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_publish() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,7 +62,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'title' => 'Test', 'post_status' => 'publish' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'contributor', 'contributor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'title' => 'Test', 'wp_author_id' => $other_author_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_other_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,7 +81,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'title' => 'Test', 'wp_author_id' => $other_author_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'contributor', 'contributor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,7 +93,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'title' => 'Test', 'wp_author_id' => 99999999 );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 404, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,7 +102,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'title' => 'Test' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $result );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -121,7 +121,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'title' => 'Post Thumbnail Test', 'wp_post_thumbnail' => $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $attachment_id, get_post_meta( $result, '_thumbnail_id', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_support( 'post-thumbnails' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,7 +132,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'title' => 'Test', 'post_type' => 'page' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,7 +141,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'title' => 'Test', 'post_type' => 'page' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $result );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -162,7 +162,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_status' => 'draft'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $result );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpdeletePostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/deletePost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/deletePost.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/deletePost.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'username', 'password', 0 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,7 +15,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'editor', 'editor', 340982340 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 404, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'subscriber', 'subscriber', $post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'editor', 'editor', $post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpdeleteTermphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'username', 'password', 'category', 0 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,7 +22,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', '', 0 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', 'not_existing', 0 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', 'category', self::$term_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Sorry, you are not allowed to delete this term.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,7 +49,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', '' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 500, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __('Empty Term'), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,7 +58,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', 9999 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 404, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid term ID.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +67,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', self::$term_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'boolean', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpeditCommentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/editComment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/editComment.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/editComment.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,7 +22,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editComment( array( 1, 'author', 'author', $comment_id, array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'status' => 'hold'
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,7 +42,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editComment( array( 1, 'author', 'author', $comment_id, array( 'status' => 'hold' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Sorry, you are not allowed to moderate or edit this comment.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpeditPostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/editPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/editPost.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/editPost.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'username', 'password', 0, array() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_title = 'Post test (updated)';
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'post_title' => $new_title );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue($result);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,7 +37,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_title = 'Post test (updated)';
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'post_title' => $new_title );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue($result);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,7 +55,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_title = 'Post test (updated)';
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'post_title' => $new_title );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'post_author' => $author_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue($result);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,7 +88,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'post_author' => $author_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,7 +107,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'post_author' => $editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue($result);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -131,12 +131,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // add post thumbnail to post that does not have one
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'post_thumbnail' => $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // fetch the post to verify that it appears
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'post_thumbnail', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result['post_thumbnail'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $attachment_id, $result['post_thumbnail']['attachment_id'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,7 +144,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // edit the post without supplying a post_thumbnail and check that it didn't change
</span><span class="cx" style="display: block; padding: 0 10px"> $post3 = array( 'post_content' => 'Updated post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post3 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // create another attachment
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,19 +153,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // change the post's post_thumbnail
</span><span class="cx" style="display: block; padding: 0 10px"> $post4 = array( 'post_thumbnail' => $attachment2_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post4 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $attachment2_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // unset the post's post_thumbnail
</span><span class="cx" style="display: block; padding: 0 10px"> $post5 = array( 'post_thumbnail' => '' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post5 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // use invalid ID
</span><span class="cx" style="display: block; padding: 0 10px"> $post6 = array( 'post_thumbnail' => 398420983409 );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post6 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 404, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_support( 'post-thumbnails' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -191,7 +191,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue($result);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -213,7 +213,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'sticky' => false );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( is_sticky( $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -225,7 +225,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'post_password' => 'foobar', 'sticky' => false );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( is_sticky( $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -245,7 +245,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Modify the day old post. In this case, we think it was last modified yesterday.
</span><span class="cx" style="display: block; padding: 0 10px"> $struct = array( 'post_content' => 'First edit', 'if_not_modified_since' => new IXR_Date( $yesterday ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the edit went through.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'First edit', get_post( $post_id )->post_content );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,7 +253,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Modify it again. We think it was last modified yesterday, but we actually just modified it above.
</span><span class="cx" style="display: block; padding: 0 10px"> $struct = array( 'post_content' => 'Second edit', 'if_not_modified_since' => new IXR_Date( $yesterday ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 409, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the edit did not go through.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -273,7 +273,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $struct = array( 'post_content' => 'First edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure that the post status is still inherit
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'inherit', get_post( $post_id )->post_status );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -290,7 +290,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $struct = array( 'post_status' => 'doesnt_exists' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure that the post status is still inherit
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'draft', get_post( $post_id )->post_status );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -309,7 +309,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $term_id, $term_ids );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, array( 'ID' => $post_id, 'post_title' => 'Updated' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'Updated', get_post( $post_id )->post_title );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term_ids = wp_list_pluck( get_the_category( $post_id ), 'term_id' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -336,7 +336,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $new_post_content ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'Updated', get_post( $post_id )->post_title );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term_ids = wp_list_pluck( get_the_category( $post_id ), 'term_id' );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpeditProfilephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/editProfile.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/editProfile.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/editProfile.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editProfile( array( 1, 'username', 'password', array() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'bio' => rand_str(200)
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editProfile( array( 1, 'subscriber', 'subscriber', $new_data ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // verify that the new values were stored
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = array( 'password' => $new_pass );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editProfile( array( 1, 'author', 'author', $new_data ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $auth_old = wp_authenticate( 'author', 'author' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,7 +60,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = array( 'email' => $new_email );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editProfile( array( 1, 'editor', 'editor', $new_data ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user_data = get_userdata( $editor_id );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpeditTermphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/editTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/editTerm.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/editTerm.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,7 +22,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'username', 'password', 'category', 1 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -30,7 +30,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', '', array( 'taxonomy' => '' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', self::$parent_term, array( 'taxonomy' => 'not_existing' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,7 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', self::$parent_term, array( 'taxonomy' => 'category' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Sorry, you are not allowed to edit this term.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,7 +57,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', 9999, array( 'taxonomy' => 'category' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 404, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid term ID.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,7 +66,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', '', array( 'taxonomy' => 'category' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 500, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __('Empty Term'), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$parent_term, array( 'taxonomy' => 'category', 'name' => '' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'The term name cannot be empty.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,7 +84,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$post_tag, array( 'taxonomy' => 'post_tag', 'parent' => self::$parent_term ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( "This taxonomy is not hierarchical so you can't set a parent." ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,7 +93,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'parent' => '', 'name' => 'test' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,7 +102,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'parent' => NULL, 'name' => 'test' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'boolean', $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( self::$child_term, 'category' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,7 +113,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'parent' => 'dasda', 'name' => 'test' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 500, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -121,7 +121,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'parent' => 9999, 'name' => 'test' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Parent term does not exist.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -131,7 +131,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_term = get_term_by( 'id', self::$parent_term, 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'slug' => $parent_term->slug ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 500, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( htmlspecialchars( sprintf( __('The slug “%s” is already in use by another term'), $parent_term->slug ) ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,7 +142,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array( 'taxonomy' => 'category', 'name' => 'Child 2', 'parent' => self::$parent_term, 'description' => 'Child term', 'slug' => 'child_2' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, $fields ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'boolean', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetCommentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getComment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getComment.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getComment.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,7 +35,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'username', 'password', self::$parent_comment_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,7 +43,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'contributor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'contributor', 'contributor', self::$parent_comment_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'editor', 'editor', self::$parent_comment_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check data types
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['user_id'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,7 +87,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'editor', 'editor', self::$child_comment_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( self::$child_comment_id, $result['comment_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( self::$parent_comment_id, $result['parent'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,7 +97,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'editor', 'editor', 123456789 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 404, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetCommentsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getComments.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getComments.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getComments.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComments( array( 1, 'username', 'password', array() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'contributor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComments( array( 1, 'contributor', 'contributor', array() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', array() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach( $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $result['comment_id'], ARRAY_A );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_id' => $this->post_id
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach( $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $this->post_id, $result['post_id'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,7 +60,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_id' => $this->post_id,
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // if no 'number' filter is specified, default should be 10
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 10, $results );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,7 +69,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_id' => $this->post_id,
</span><span class="cx" style="display: block; padding: 0 10px"> 'number' => 5
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 5, $results2 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComments( array( 1, 'contributor', 'contributor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -140,7 +140,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result1 = $this->myxmlrpcserver->wp_getComments( array( 1, 'author', 'author', array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_id' => $author_post_id
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result1 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result2 = $this->myxmlrpcserver->wp_getComments( array( 1, 'author', 'author', array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'status' => 'approve',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,7 +153,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result3 = $this->myxmlrpcserver->wp_getComments( array( 1, 'author', 'author', array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_id' => $editor_post_id
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result3 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result3 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result4 = $this->myxmlrpcserver->wp_getComments( array( 1, 'author', 'author', array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'status' => 'approve',
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetMediaItemphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,7 +38,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getMediaItem( array( 1, 'username', 'password', 0 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,7 +47,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array( 'post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getMediaItem( array( 1, 'author', 'author', $this->attachment_id, $fields ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check data types
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['attachment_id'] );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetOptionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getOptions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getOptions.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getOptions.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'username', 'password' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPagephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getPage.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPage.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPage.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPage( array( 1, self::$post_id, 'username', 'password' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPage( array( 1, 9999, 'editor', 'editor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 404, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPage( array( 1, self::$post_id, 'editor', 'editor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check data types
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['userid'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -80,7 +80,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPage( array( 1, self::$post_id, 'editor', 'editor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result['dateCreated'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result['date_created_gmt'] );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPageListphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getPageList.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPageList.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPageList.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPageList( array( 1, 'username', 'password' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,7 +28,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'contributor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPageList( array( 1, 'contributor', 'contributor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getPageList( array( 1, 'editor', 'editor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach( $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $page = get_post( $result->page_id );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPagesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getPages.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPages.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPages.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,7 +26,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPages( array( 1, 'username', 'password' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,13 +34,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'contributor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPages( array( 1, 'contributor', 'contributor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_user() {
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getPages( array( 1, 'administrator', 'administrator' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach( $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $page = get_post( $result['page_id'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,12 +65,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'map_meta_cap', array( $this, 'remove_editor_edit_page_cap') , 10, 4 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getPages( array( 1, 'editor', 'editor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found_incapable = false;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach( $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // WP#20629
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $result['page_id'] == self::$post_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $found_incapable = true;
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPost.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPost.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'username', 'password', 1 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array( 'post', 'custom_fields' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $this->post_id, $fields ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check data types
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['post_id'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,7 +79,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_no_fields() {
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $this->post_id, $fields ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // when no fields are requested, only the IDs should be returned
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1, count( $result ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,7 +88,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_default_fields() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $this->post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'post_id', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'link', $result ); // random field from 'posts' group
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,7 +99,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_date() {
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array( 'post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $this->post_id, $fields ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result['post_date'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result['post_date_gmt'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,7 +130,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'editor', 'editor', $child_page_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['post_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['post_parent'] );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPostTypephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getPostType.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPostType.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPostType.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'username', 'password', 'post' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'editor', 'editor', 'foobar' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,14 +47,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'editor', 'editor', 'post' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'subscriber', 'subscriber', 'post' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,7 +62,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'editor', 'editor', $this->cpt_name, array( 'labels', 'cap', 'menu', 'taxonomies' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // check data types
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['name'] );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPostTypesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getPostTypes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPostTypes.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPostTypes.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,7 +6,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_XMLRPC_wp_getPostTypes extends WP_XMLRPC_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'username', 'password', 'post' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'subscriber', 'subscriber' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, count( $result ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'editor', 'editor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertGreaterThan( 0, count( $result ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'editor', 'editor', array( 'hierarchical' => true ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // verify that pages is in the result, and post is not
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPostsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'username', 'password' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,12 +18,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'subscriber', 'subscriber' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'post_type' => 'page' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'subscriber', 'subscriber', $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_post_type() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'post_type' => 'invalid_post_type_name' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filters() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,7 +62,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // get them all
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'post_type' => $cpt_name, 'number' => $num_posts + 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $num_posts, count( $results ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // page through results
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,7 +86,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // get results ordered by comment count
</span><span class="cx" style="display: block; padding: 0 10px"> $filter2 = array( 'post_type' => $cpt_name, 'number' => $num_posts, 'orderby' => 'comment_count', 'order' => 'DESC' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results2 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $last_comment_count = 100;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $results2 as $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_count = intval( get_comments_number( $post['post_id'] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,7 +100,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_post( $post );
</span><span class="cx" style="display: block; padding: 0 10px"> $filter3 = array( 'post_type' => $cpt_name, 'post_status' => 'draft' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results3 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter3 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results3 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results3 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1, count( $results3 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post->ID, $results3[0]['post_id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,7 +113,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // check default fields
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected_fields = array( 'post_id', 'post_title', 'terms', 'custom_fields', 'link' ); // subset of expected fields
</span><span class="cx" style="display: block; padding: 0 10px"> foreach( $expected_fields as $field ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $field, $results[0] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,7 +123,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array( 'post_name', 'post_author', 'enclosure' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results2 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter, $fields ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected_fields = array_merge( $fields, array( 'post_id' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array_keys( $results2[0] ) as $field ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $field, $expected_fields );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,13 +142,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Search for none of them
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 's' => 'Third' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, count( $results ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Search for one of them
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 's' => 'First:' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1, count( $results ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetProfilephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getProfile.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getProfile.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getProfile.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'username', 'password' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $subscriber_id = $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'subscriber', 'subscriber' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $subscriber_id, $result['user_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'subscriber', $result['roles'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $administrator_id = $this->make_user_by_role( 'administrator' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'administrator', 'administrator' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $administrator_id, $result['user_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'administrator', $result['roles'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array( 'email', 'bio', 'user_contacts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'editor', 'editor', $fields ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $editor_id, $result['user_id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_fields = array( 'user_id', 'email', 'bio' );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetRevisionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getRevisions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getRevisions.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getRevisions.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'username', 'password', 0 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'subscriber', 'subscriber', $post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,7 +26,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'editor', 'editor', $post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_revision_count() {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetTaxonomiesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomies.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomies.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomies.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomies( array( 1, 'username', 'password' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,6 +15,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomies( array( 1, 'editor', 'editor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetTaxonomyphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'username', 'password', 'category' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,7 +15,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', '' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'not_existing' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'subscriber', 'subscriber', 'category' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,14 +42,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'category' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_prepare_taxonomy() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'category' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $taxonomy = get_taxonomy( 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'category', $result['name'], 'name' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( true, $result['_builtin'], '_builtin' );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetTermphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getTerm.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getTerm.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,7 +15,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'username', 'password', 'category', 1 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', '', 0 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'not_existing', 0 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,7 +41,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'subscriber', 'subscriber', 'category', self::$term_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Sorry, you are not allowed to assign this term.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', '' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 500, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __('Empty Term'), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,7 +60,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', 9999 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 404, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid term ID.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', self::$term_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $result, $term );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check DataTypes
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetTermsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getTerms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getTerms.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getTerms.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'username', 'password', 'category' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,7 +15,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', '' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'not_existing' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'subscriber', 'subscriber', 'category' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $cat = wp_insert_term( 'term_' . __FUNCTION__ , 'category' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach( $results as $term ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', $term['count'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // test fetching all terms
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $num_terms, count( $results ) );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $results as $term ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,20 +81,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // test paged results
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'number' => 5 );
</span><span class="cx" style="display: block; padding: 0 10px"> $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 5, count( $results2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $results[1]['term_id'], $results2[1]['term_id'] ); // check one of the terms
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filter['offset'] = 10;
</span><span class="cx" style="display: block; padding: 0 10px"> $results3 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results3 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results3 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $num_terms - 10, count( $results3 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $results[11]['term_id'], $results3[1]['term_id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // test hide_empty (since none have been attached to posts yet, all should be hidden
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'hide_empty' => true );
</span><span class="cx" style="display: block; padding: 0 10px"> $results4 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results4 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results4 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, count( $results4 ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unset($GLOBALS['wp_taxonomies'][$tax_name]);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,7 +111,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'orderby' => 'count', 'order' => 'DESC' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( 0, count( $results ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach( $results as $term ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,7 +133,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // search by full name
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'search' => $name );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1, count( $results ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $name, $results[0]['name'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $name_id, $results[0]['term_id'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,7 +141,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // search by partial name
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'search' => substr( $name, 0, 10 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1, count( $results2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $name, $results2[0]['name'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $name_id, $results2[0]['term_id'] );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetUserphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getUser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getUser.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getUser.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,13 +25,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'username', 'password', 1 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_user() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', 34902348908234 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 404, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $editor_id = $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'subscriber', 'subscriber', $editor_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,7 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $subscriber_id = $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'subscriber', 'subscriber', $subscriber_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $subscriber_id, $result['user_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user_id = wp_insert_user( $user_data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', $user_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // check data types
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['user_id'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,7 +111,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $editor_id = $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', $editor_id, array() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $editor_id, $result['user_id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_fields = array( 'user_id' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,7 +122,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $editor_id = $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', $editor_id, array( 'basic' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $editor_id, $result['user_id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_fields = array( 'user_id', 'username', 'email', 'registered', 'display_name', 'nicename' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,7 +138,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array( 'email', 'bio', 'user_contacts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', $editor_id, $fields ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $editor_id, $result['user_id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_fields = array( 'user_id', 'email', 'bio' );
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetUsersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/getUsers.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getUsers.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getUsers.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'username', 'password' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $results->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'subscriber', 'subscriber' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $results->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'administrator' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // check data types
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result[0]['user_id'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,7 +49,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'role' => 'invalidrole' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $results->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,14 +63,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // test a single role ('editor')
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'role' => 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $results );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $editor_id, $results[0]['user_id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // test 'authors', which should return all non-subscribers
</span><span class="cx" style="display: block; padding: 0 10px"> $filter2 = array( 'who' => 'authors' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results2 = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, array_intersect( array( $author_id, $editor_id, $administrator_id ), wp_list_pluck( $results2, 'user_id' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'orderby' => 'email', 'order' => 'ASC' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $last_email = '';
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $results as $user ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpnewCommentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/newComment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/newComment.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/newComment.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => rand_str( 100 )
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_comment() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => ''
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => rand_str( 100 ),
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,12 +54,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // First time it's a valid comment
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newComment( $comment_args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Run second time for duplication error
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newComment( $comment_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpnewPostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'username', 'password', array() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,7 +15,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'subscriber', 'subscriber', array() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'author' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', array() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 500, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'Content, title, and excerpt are empty.', $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,7 +42,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'ID' => 103948 );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( '103948', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'post_status' => 'publish' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_publish() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'post_status' => 'publish' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,7 +68,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'post_status' => 'private' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_private() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,7 +76,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'post_status' => 'private' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,7 +86,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'post_author' => $other_author_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_other_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,7 +95,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'post_author' => $other_author_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'post_author' => 99999999 );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 404, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,7 +113,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $result );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,7 +132,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Post Thumbnail Test', 'post_thumbnail' => $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $attachment_id, get_post_meta( $result, '_thumbnail_id', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_support( 'post-thumbnails' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,7 +143,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'post_status' => 'foobar_status' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'draft', get_post_status( $result ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -152,7 +152,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'sticky' => true );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,7 +161,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'sticky' => true );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_sticky( $result ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,7 +170,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'post_status' => 'private', 'sticky' => true );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,7 +179,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'post_format' => 'quote' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'quote', get_post_format( $result ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -188,7 +188,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array( 'post_title' => 'Test', 'post_format' => 'tumblr' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( '', get_post_format( $result ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,7 +202,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -212,7 +212,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result2 = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result2->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -226,7 +226,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -247,7 +247,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_tags = wp_get_object_terms( $result, 'post_tag', array( 'fields' => 'ids' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( $tag1['term_id'], $post_tags );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,7 +274,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> // verify that cat2 was created
</span><span class="cx" style="display: block; padding: 0 10px"> $cat2 = get_term_by( 'name', $cat2_name, 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $cat2 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -291,7 +291,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result2 = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result2->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpnewTermphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/newTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/newTerm.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/newTerm.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,7 +15,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'username', 'password', array() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => '' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'not_existing' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,7 +41,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'subscriber', 'subscriber', array( 'taxonomy' => 'category' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Sorry, you are not allowed to create terms in this taxonomy.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,7 +50,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'name' => '' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'The term name cannot be empty.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'post_tag', 'parent' => self::$parent_term_id, 'name' => 'test' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'This taxonomy is not hierarchical.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,7 +68,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => 'dasda', 'name' => 'test' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 500, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,7 +76,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => 9999, 'name' => 'test' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( __( 'Parent term does not exist.' ), $result->message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,7 +86,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'name' => 'test' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,7 +94,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => self::$parent_term_id, 'name' => 'test' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -103,7 +103,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $taxonomy = array( 'taxonomy' => 'category', 'parent' => self::$parent_term_id, 'name' => 'test_all', 'description' => 'Test all', 'slug' => 'test_all' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', $taxonomy ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwprestoreRevisionphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/restoreRevision.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/restoreRevision.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/restoreRevision.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'username', 'password', $this->revision_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 403, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'subscriber', 'subscriber', $this->revision_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 401, $result->code );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_user_by_role( 'editor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'editor', 'editor', $this->revision_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_revision_restored() {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpuploadFilephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/xmlrpc/wp/uploadFile.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/uploadFile.php 2017-04-11 10:48:00 UTC (rev 40416)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/uploadFile.php 2017-04-12 14:58:33 UTC (rev 40417)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newMediaObject( array( 0, 'editor', 'editor', $data ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotInstanceOf( 'IXR_Error', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotIXRError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // check data types
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['id'] );
</span></span></pre>
</div>
</div>
</body>
</html>