<!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>[39174] trunk/tests/phpunit/tests: Build/Test Tools: Utilise `assertWPError()` and `assertNotWPError()` in more places.</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/39174">39174</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/39174","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>2016-11-09 00:01:42 +0000 (Wed, 09 Nov 2016)</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: Utilise `assertWPError()` and `assertNotWPError()` in more places.
See <a href="https://core.trac.wordpress.org/ticket/38716">#38716</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestsgeneralerrorsphp">trunk/tests/phpunit/tests/general/errors.php</a></li>
<li><a href="#trunktestsphpunittestshttpbasephp">trunk/tests/phpunit/tests/http/base.php</a></li>
<li><a href="#trunktestsphpunittestsimportparserphp">trunk/tests/phpunit/tests/import/parser.php</a></li>
<li><a href="#trunktestsphpunittestspostphp">trunk/tests/phpunit/tests/post.php</a></li>
<li><a href="#trunktestsphpunitteststermgetTheTermsphp">trunk/tests/phpunit/tests/term/getTheTerms.php</a></li>
<li><a href="#trunktestsphpunitteststermtaxQueryphp">trunk/tests/phpunit/tests/term/taxQuery.php</a></li>
<li><a href="#trunktestsphpunitteststermwpInsertTermphp">trunk/tests/phpunit/tests/term/wpInsertTerm.php</a></li>
<li><a href="#trunktestsphpunitteststermwpSetObjectTermsphp">trunk/tests/phpunit/tests/term/wpSetObjectTerms.php</a></li>
<li><a href="#trunktestsphpunitteststermwpUpdateTermphp">trunk/tests/phpunit/tests/term/wpUpdateTerm.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpeditProfilephp">trunk/tests/phpunit/tests/xmlrpc/wp/editProfile.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsphpunittestsgeneralerrorsphp"></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/general/errors.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/general/errors.php 2016-11-08 23:49:11 UTC (rev 39173)
+++ trunk/tests/phpunit/tests/general/errors.php 2016-11-09 00:01:42 UTC (rev 39174)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,7 +9,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_create_error() {
</span><span class="cx" style="display: block; padding: 0 10px"> $error = new WP_Error( 'foo', 'message', 'data' );
</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->assertTrue( is_wp_error( $error ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $error );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'foo', $error->get_error_code() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'message', $error->get_error_message() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'data', $error->get_error_data() );
</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"> $error = new WP_Error();
</span><span class="cx" style="display: block; padding: 0 10px"> $error->add( 'foo', 'message', 'data' );
</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->assertTrue( is_wp_error( $error ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $error );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'foo', $error->get_error_code() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'message', $error->get_error_message() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'data', $error->get_error_data() );
</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"> $error->add( 'foo', 'foo message', 'foo data' );
</span><span class="cx" style="display: block; padding: 0 10px"> $error->add( 'bar', 'bar message', 'bar data' );
</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->assertTrue( is_wp_error( $error ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $error );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'foo', $error->get_error_code() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'foo message', $error->get_error_message() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'foo data', $error->get_error_data() );
</span></span></pre></div>
<a id="trunktestsphpunittestshttpbasephp"></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/http/base.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/http/base.php 2016-11-08 23:49:11 UTC (rev 39173)
+++ trunk/tests/phpunit/tests/http/base.php 2016-11-09 00:01:42 UTC (rev 39174)
</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"> function test_redirections_greater() {
</span><span class="cx" style="display: block; padding: 0 10px"> // 10 > 5
</span><span class="cx" style="display: block; padding: 0 10px"> $res = wp_remote_request($this->redirection_script . '?rt=' . 10, array('redirection' => 5) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error($res), print_r($res, true) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $res );
</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_redirections_greater_edgecase() {
</span><span class="cx" style="display: block; padding: 0 10px"> // 6 > 5 (close edgecase)
</span><span class="cx" style="display: block; padding: 0 10px"> $res = wp_remote_request($this->redirection_script . '?rt=' . 6, array('redirection' => 5) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error($res) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $res );
</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_redirections_less_edgecase() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -387,7 +387,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->markTestSkipped( 'This install of PHP does not support SSL' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $res = wp_remote_get( 'https://wordpress.org/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( ! is_wp_error( $res ), print_r( $res, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNotWPError( $res );
</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"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsimportparserphp"></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/import/parser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/import/parser.php 2016-11-08 23:49:11 UTC (rev 39173)
+++ trunk/tests/phpunit/tests/import/parser.php 2016-11-09 00:01:42 UTC (rev 39174)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,7 +29,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML' ) as $p ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $parser = new $p;
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $parser->parse($file);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'There was an error when reading this WXR file', $result->get_error_message() );
</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"> foreach ( array( $f1, $f2 ) as $file ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $parser = new $p;
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $parser->parse( $file );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'This does not appear to be a WXR file, missing/invalid WXR version number', $result->get_error_message() );
</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="trunktestsphpunittestspostphp"></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/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post.php 2016-11-08 23:49:11 UTC (rev 39173)
+++ trunk/tests/phpunit/tests/post.php 2016-11-09 00:01:42 UTC (rev 39174)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -381,7 +381,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test both return paths with or without WP_Error
</span><span class="cx" style="display: block; padding: 0 10px"> $insert_post = wp_insert_post( $post, true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error( $insert_post ), 'Did not get a WP_Error back from wp_insert_post' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $insert_post );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 'invalid_date', $insert_post->get_error_code() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $insert_post = wp_insert_post( $post );
</span></span></pre></div>
<a id="trunktestsphpunitteststermgetTheTermsphp"></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/term/getTheTerms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/getTheTerms.php 2016-11-08 23:49:11 UTC (rev 39173)
+++ trunk/tests/phpunit/tests/term/getTheTerms.php 2016-11-09 00:01:42 UTC (rev 39174)
</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"> function test_get_the_terms_should_return_wp_error_when_taxonomy_is_unregistered() {
</span><span class="cx" style="display: block; padding: 0 10px"> $p = self::$post_ids[0];
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_the_terms( $p, 'this-taxonomy-does-not-exist' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error( $terms ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $terms );
</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"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststermtaxQueryphp"></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/term/taxQuery.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/taxQuery.php 2016-11-08 23:49:11 UTC (rev 39173)
+++ trunk/tests/phpunit/tests/term/taxQuery.php 2016-11-09 00:01:42 UTC (rev 39174)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -231,7 +231,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $tq->transform_query( $tq->queries[0], 'term_taxonomy_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->assertTrue( is_wp_error( $tq->queries[0] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $tq->queries[0] );
</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"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststermwpInsertTermphp"></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/term/wpInsertTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/wpInsertTerm.php 2016-11-08 23:49:11 UTC (rev 39173)
+++ trunk/tests/phpunit/tests/term/wpInsertTerm.php 2016-11-09 00:01:42 UTC (rev 39174)
</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"> public function test_wp_insert_term_taxonomy_does_not_exist() {
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_insert_term( 'foo', 'bar' );
</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->assertTrue( is_wp_error( $found ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'invalid_taxonomy', $found->get_error_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">@@ -57,21 +57,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_insert_term( 'foo', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_insert_term', array( $this, '_pre_insert_term_callback' ) );
</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->assertTrue( is_wp_error( $found ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'custom_error', $found->get_error_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"> public function test_wp_insert_term_term_0() {
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_insert_term( 0, 'post_tag' );
</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->assertTrue( is_wp_error( $found ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'invalid_term_id', $found->get_error_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"> public function test_wp_insert_term_term_trims_to_empty_string() {
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_insert_term( ' ', 'post_tag' );
</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->assertTrue( is_wp_error( $found ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'empty_term_name', $found->get_error_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">@@ -80,7 +80,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'parent' => 999999,
</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->assertTrue( is_wp_error( $found ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'missing_parent', $found->get_error_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">@@ -170,7 +170,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test an existing term name
</span><span class="cx" style="display: block; padding: 0 10px"> $term2 = self::factory()->tag->create( array( 'name' => 'Bozo' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error( $term2 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $term2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $term2->errors );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test named terms ending in special characters
</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"> $term5 = self::factory()->tag->create( array( 'name' => 'T$$$' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $term6 = self::factory()->tag->create( array( 'name' => 'T$$$$' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $term7 = self::factory()->tag->create( array( 'name' => 'T$$$$' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error( $term7 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $term7 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $term7->errors );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $term6, $term7->error_data['term_exists'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -192,7 +192,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term10 = self::factory()->tag->create( array( 'name' => '$$$' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $term11 = self::factory()->tag->create( array( 'name' => '$$$$' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $term12 = self::factory()->tag->create( array( 'name' => '$$$$' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error( $term12 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $term12 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $term12->errors );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $term11, $term12->error_data['term_exists'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,17 +202,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term13 = self::factory()->tag->create( array( 'name' => 'A' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $term13 );
</span><span class="cx" style="display: block; padding: 0 10px"> $term14 = self::factory()->tag->create( array( 'name' => 'A' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error( $term14 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $term14 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $term15 = self::factory()->tag->create( array( 'name' => 'A+', 'slug' => 'a' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $term15 );
</span><span class="cx" style="display: block; padding: 0 10px"> $term16 = self::factory()->tag->create( array( 'name' => 'A+' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error( $term16 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $term16 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $term17 = self::factory()->tag->create( array( 'name' => 'A++' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $term17 );
</span><span class="cx" style="display: block; padding: 0 10px"> $term18 = self::factory()->tag->create( array( 'name' => 'A-', 'slug' => 'a' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $term18 );
</span><span class="cx" style="display: block; padding: 0 10px"> $term19 = self::factory()->tag->create( array( 'name' => 'A-' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error( $term19 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $term19 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $term20 = self::factory()->tag->create( array( 'name' => 'A--' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $term20 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunitteststermwpSetObjectTermsphp"></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/term/wpSetObjectTerms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/wpSetObjectTerms.php 2016-11-08 23:49:11 UTC (rev 39173)
+++ trunk/tests/phpunit/tests/term/wpSetObjectTerms.php 2016-11-09 00:01:42 UTC (rev 39174)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,7 +165,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_set_object_terms_invalid() {
</span><span class="cx" style="display: block; padding: 0 10px"> // bogus taxonomy
</span><span class="cx" style="display: block; padding: 0 10px"> $result = wp_set_object_terms( self::$post_ids[0], array(rand_str()), rand_str() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error($result) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $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"> public function test_wp_set_object_terms_append_true() {
</span></span></pre></div>
<a id="trunktestsphpunitteststermwpUpdateTermphp"></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/term/wpUpdateTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/wpUpdateTerm.php 2016-11-08 23:49:11 UTC (rev 39173)
+++ trunk/tests/phpunit/tests/term/wpUpdateTerm.php 2016-11-09 00:01:42 UTC (rev 39174)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,14 +7,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_update_term_taxonomy_does_not_exist() {
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_update_term( 1, 'bar' );
</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->assertTrue( is_wp_error( $found ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'invalid_taxonomy', $found->get_error_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"> public function test_wp_update_term_term_empty_string_should_return_wp_error() {
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_update_term( '', 'post_tag' );
</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->assertTrue( is_wp_error( $found ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'invalid_term', $found->get_error_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">@@ -60,7 +60,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'name' => '',
</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->assertTrue( is_wp_error( $found ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'empty_term_name', $found->get_error_code() );
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( 'wptests_tax' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</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 2016-11-08 23:49:11 UTC (rev 39173)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/editProfile.php 2016-11-09 00:01:42 UTC (rev 39174)
</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"> $auth_old = wp_authenticate( 'author', 'author' );
</span><span class="cx" style="display: block; padding: 0 10px"> $auth_new = wp_authenticate( 'author', $new_pass );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $auth_old );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertTrue( is_wp_error( $auth_new ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertWPError( $auth_new );
</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_ignore_email_change() {
</span></span></pre>
</div>
</div>
</body>
</html>