<!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>[35244] trunk/tests/phpunit: Unit Tests: `WP_UnitTest_Generator_Sequence` needs a static incrementer - otherwise, it assumes every test class is a reset, which it no longer is (it is now static).</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/35244">35244</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/35244","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-10-17 19:24:20 +0000 (Sat, 17 Oct 2015)</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'>Unit Tests: `WP_UnitTest_Generator_Sequence` needs a static incrementer - otherwise, it assumes every test class is a reset, which it no longer is (it is now static).
While we're at it, remove unnecessary `tearDown()` code.
See <a href="https://core.trac.wordpress.org/ticket/30017">#30017</a>, <a href="https://core.trac.wordpress.org/ticket/33968">#33968</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktestsphpunitincludesfactoryphp">trunk/tests/phpunit/includes/factory.php</a></li>
<li><a href="#trunktestsphpunitincludestestcasecanonicalphp">trunk/tests/phpunit/includes/testcase-canonical.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesPostphp">trunk/tests/phpunit/tests/admin/includesPost.php</a></li>
<li><a href="#trunktestsphpunittestsajaxAutosavephp">trunk/tests/phpunit/tests/ajax/Autosave.php</a></li>
<li><a href="#trunktestsphpunittestsajaxCustomizeMenusphp">trunk/tests/phpunit/tests/ajax/CustomizeMenus.php</a></li>
<li><a href="#trunktestsphpunittestsattachmentslashesphp">trunk/tests/phpunit/tests/attachment/slashes.php</a></li>
<li><a href="#trunktestsphpunittestsbasicphp">trunk/tests/phpunit/tests/basic.php</a></li>
<li><a href="#trunktestsphpunittestscachephp">trunk/tests/phpunit/tests/cache.php</a></li>
<li><a href="#trunktestsphpunittestscommentslashesphp">trunk/tests/phpunit/tests/comment/slashes.php</a></li>
<li><a href="#trunktestsphpunittestscommentsubmissionphp">trunk/tests/phpunit/tests/comment-submission.php</a></li>
<li><a href="#trunktestsphpunittestscommentphp">trunk/tests/phpunit/tests/comment.php</a></li>
<li><a href="#trunktestsphpunittestslinkphp">trunk/tests/phpunit/tests/link.php</a></li>
<li><a href="#trunktestsphpunittestsmetaslashesphp">trunk/tests/phpunit/tests/meta/slashes.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitegetSpaceAllowedphp">trunk/tests/phpunit/tests/multisite/getSpaceAllowed.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitesitephp">trunk/tests/phpunit/tests/multisite/site.php</a></li>
<li><a href="#trunktestsphpunittestsoptionuserSettingsphp">trunk/tests/phpunit/tests/option/userSettings.php</a></li>
<li><a href="#trunktestsphpunittestspostgetPagesphp">trunk/tests/phpunit/tests/post/getPages.php</a></li>
<li><a href="#trunktestsphpunittestspostmetaphp">trunk/tests/phpunit/tests/post/meta.php</a></li>
<li><a href="#trunktestsphpunittestspostslashesphp">trunk/tests/phpunit/tests/post/slashes.php</a></li>
<li><a href="#trunktestsphpunittestspostthumbnailsphp">trunk/tests/phpunit/tests/post/thumbnails.php</a></li>
<li><a href="#trunktestsphpunittestsqueryconditionalsphp">trunk/tests/phpunit/tests/query/conditionals.php</a></li>
<li><a href="#trunktestsphpunittestsquerysetupPostdataphp">trunk/tests/phpunit/tests/query/setupPostdata.php</a></li>
<li><a href="#trunktestsphpunittestsshortcodephp">trunk/tests/phpunit/tests/shortcode.php</a></li>
<li><a href="#trunktestsphpunitteststermslashesphp">trunk/tests/phpunit/tests/term/slashes.php</a></li>
<li><a href="#trunktestsphpunitteststermphp">trunk/tests/phpunit/tests/term.php</a></li>
<li><a href="#trunktestsphpunittestsusercountUserPostsphp">trunk/tests/phpunit/tests/user/countUserPosts.php</a></li>
<li><a href="#trunktestsphpunittestsuserlistAuthorsphp">trunk/tests/phpunit/tests/user/listAuthors.php</a></li>
<li><a href="#trunktestsphpunittestsuserqueryphp">trunk/tests/phpunit/tests/user/query.php</a></li>
<li><a href="#trunktestsphpunittestsuserslashesphp">trunk/tests/phpunit/tests/user/slashes.php</a></li>
<li><a href="#trunktestsphpunittestsuserphp">trunk/tests/phpunit/tests/user.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcmwgetRecentPostsphp">trunk/tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPagephp">trunk/tests/phpunit/tests/xmlrpc/wp/getPage.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetUserphp">trunk/tests/phpunit/tests/xmlrpc/wp/getUser.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsphpunitincludesfactoryphp"></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/factory.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/includes/factory.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/includes/factory.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -401,11 +401,17 @@
</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"> class WP_UnitTest_Generator_Sequence {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var $next;
- var $template_string;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ static $incr = -1;
+ public $next;
+ public $template_string;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function __construct( $template_string = '%s', $start = 1 ) {
- $this->next = $start;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function __construct( $template_string = '%s', $start = null ) {
+ if ( $start ) {
+ $this->next = $start;
+ } else {
+ self::$incr++;
+ $this->next = self::$incr;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->template_string = $template_string;
</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="trunktestsphpunitincludestestcasecanonicalphp"></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-canonical.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/includes/testcase-canonical.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/includes/testcase-canonical.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,11 +134,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function delete_shared_fixtures() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_multisite() ) {
- wpmu_delete_user( self::$author_id );
- } else {
- wp_delete_user( self::$author_id );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self::delete_user( self::$author_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( self::$post_ids as $pid ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $pid, true );
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesPostphp"></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/admin/includesPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesPost.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/admin/includesPost.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,11 +5,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Admin_includesPost extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function tearDown() {
- wp_set_current_user( 0 );
- parent::tearDown();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> function test__wp_translate_postdata_cap_checks_contributor() {
</span><span class="cx" style="display: block; padding: 0 10px"> $contributor_id = self::factory()->user->create( array( 'role' => 'contributor' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $editor_id = self::factory()->user->create( array( 'role' => 'editor' ) );
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxAutosavephp"></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/ajax/Autosave.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/Autosave.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/ajax/Autosave.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,15 +41,6 @@
</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"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Tear down the test fixture.
- * Reset the current user
- */
- public function tearDown() {
- wp_set_current_user( 0 );
- parent::tearDown();
- }
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * Test autosaving a post
</span><span class="cx" style="display: block; padding: 0 10px"> * @return void
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxCustomizeMenusphp"></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/ajax/CustomizeMenus.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/CustomizeMenus.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/ajax/CustomizeMenus.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,14 +29,6 @@
</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"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Tear down the test fixture.
- */
- public function tearDown() {
- wp_set_current_user( 0 );
- parent::tearDown();
- }
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * Helper to keep it DRY
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $action Action.
</span></span></pre></div>
<a id="trunktestsphpunittestsattachmentslashesphp"></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/attachment/slashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/attachment/slashes.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/attachment/slashes.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,7 +9,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function setUp() {
</span><span class="cx" style="display: block; padding: 0 10px"> parent::setUp();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->author_id = self::factory()->user->create( array( 'role' => 'editor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->old_current_user = get_current_user_id();
</del><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $this->author_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // it is important to test with both even and odd numbered slashes as
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,12 +22,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
</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">- function tearDown() {
- wp_set_current_user( $this->old_current_user );
- wp_delete_user( $this->author_id );
- parent::tearDown();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Tests the model function that expects slashed data
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="trunktestsphpunittestsbasicphp"></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/basic.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/basic.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/basic.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,22 +5,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @group testsuite
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Basic extends WP_UnitTestCase {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var $val;
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function setUp() {
- parent::setUp();
- $this->val = true;
- }
-
- function tearDown() {
- $this->val = false;
- parent::tearDown();
- }
-
- function test_true() {
- $this->assertTrue($this->val);
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> function test_license() {
</span><span class="cx" style="display: block; padding: 0 10px"> $license = file_get_contents( ABSPATH . 'license.txt' );
</span><span class="cx" style="display: block; padding: 0 10px"> preg_match( '#Copyright (\d+) by the contributors#', $license, $matches );
</span></span></pre></div>
<a id="trunktestsphpunittestscachephp"></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/cache.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/cache.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/cache.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,7 +4,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @group cache
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Cache extends WP_UnitTestCase {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var $cache = NULL;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var $cache = null;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function setUp() {
</span><span class="cx" style="display: block; padding: 0 10px"> parent::setUp();
</span></span></pre></div>
<a id="trunktestsphpunittestscommentslashesphp"></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/comment/slashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/slashes.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/comment/slashes.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,7 +10,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::setUp();
</span><span class="cx" style="display: block; padding: 0 10px"> // we need an admin user to bypass comment flood protection
</span><span class="cx" style="display: block; padding: 0 10px"> $this->author_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->old_current_user = get_current_user_id();
</del><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $this->author_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // it is important to test with both even and odd numbered slashes as
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,11 +23,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
</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">- function tearDown() {
- wp_set_current_user( $this->old_current_user );
- parent::tearDown();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Tests the extended model function that expects slashed data
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="trunktestsphpunittestscommentsubmissionphp"></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/comment-submission.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment-submission.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/comment-submission.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,13 +10,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require_once ABSPATH . WPINC . '/class-phpass.php';
</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">- function tearDown() {
- wp_set_current_user( 0 );
- parent::tearDown();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> public function test_submitting_comment_to_invalid_post_returns_error() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> $error = 'comment_id_not_found';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 0, did_action( $error ) );
</span></span></pre></div>
<a id="trunktestsphpunittestscommentphp"></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/comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/comment.php 2015-10-17 19:24:20 UTC (rev 35244)
</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">
</span><span class="cx" style="display: block; padding: 0 10px"> public static function wpTearDownAfterClass() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_delete_post( self::$post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_delete_post( self::$post_id, true );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::delete_user( self::$user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestslinkphp"></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/link.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/link.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/link.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,12 +4,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Link extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function tearDown() {
- global $wp_rewrite;
- $wp_rewrite->init();
- parent::tearDown();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> function _get_pagenum_link_cb( $url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $url . '/WooHoo';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsmetaslashesphp"></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/meta/slashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/meta/slashes.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/meta/slashes.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,7 +10,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::setUp();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->author_id = self::factory()->user->create( array( 'role' => 'editor' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->post_id = self::factory()->post->create();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->old_current_user = get_current_user_id();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $this->author_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->slash_1 = 'String with 1 slash \\';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,11 +22,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
</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">- function tearDown() {
- wp_set_current_user( $this->old_current_user );
- parent::tearDown();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Tests the controller function that expects slashed data
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitegetSpaceAllowedphp"></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/multisite/getSpaceAllowed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/getSpaceAllowed.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/multisite/getSpaceAllowed.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,7 +18,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::$original_site_blog_upload_space = get_site_option( 'blog_upload_space' );
</span><span class="cx" style="display: block; padding: 0 10px"> self::$original_blog_upload_space = get_option( 'blog_upload_space' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><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 setUp() {
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitesitephp"></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/multisite/site.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/site.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/multisite/site.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -674,7 +674,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 2, get_blog_details()->post_count );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_delete_post( $post2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_delete_post( $post2, true );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1, get_blog_details()->post_count );
</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="trunktestsphpunittestsoptionuserSettingsphp"></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/option/userSettings.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/userSettings.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/option/userSettings.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function tearDown() {
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $GLOBALS['_updated_user_settings'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- delete_user_option( $this->user_id, 'user-settings' );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> parent::tearDown();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspostgetPagesphp"></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/getPages.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/getPages.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/post/getPages.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,7 +78,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $last_changed = wp_cache_get( 'last_changed', 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // This should bump last_changed.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_delete_post( $pages[0]->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_delete_post( $pages[0]->ID, true );
</ins><span class="cx" style="display: block; padding: 0 10px"> $old_changed_float = $this->_microtime_to_float( $last_changed );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_changed_float = $this->_microtime_to_float( wp_cache_get( 'last_changed', 'posts' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertGreaterThan( $old_changed_float, $new_changed_float );
</span></span></pre></div>
<a id="trunktestsphpunittestspostmetaphp"></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/meta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/meta.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/post/meta.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,12 +32,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->post_id_2 = wp_insert_post($post);
</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">- function tearDown() {
- wp_delete_post($this->post_id);
- wp_delete_post($this->post_id_2);
- parent::tearDown();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> function test_unique_postmeta() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Add a unique post meta item
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'integer', add_post_meta($this->post_id, 'unique', 'value', true) );
</span></span></pre></div>
<a id="trunktestsphpunittestspostslashesphp"></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/slashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/slashes.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/post/slashes.php 2015-10-17 19:24:20 UTC (rev 35244)
</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 setUp() {
</span><span class="cx" style="display: block; padding: 0 10px"> parent::setUp();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->author_id = self::factory()->user->create( array( 'role' => 'editor' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->old_current_user = get_current_user_id();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $this->author_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // it is important to test with both even and odd numbered slashes as
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,11 +23,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
</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">- function tearDown() {
- wp_set_current_user( $this->old_current_user );
- parent::tearDown();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Tests the controller function that expects slashed data
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="trunktestsphpunittestspostthumbnailsphp"></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/thumbnails.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/thumbnails.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/post/thumbnails.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,8 +17,8 @@
</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 static function wpTearDownAfterClass() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_delete_post( self::$post->ID );
- wp_delete_attachment( self::$attachment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_delete_post( self::$post->ID, true );
+ wp_delete_attachment( self::$attachment_id, true );
</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_has_post_thumbnail() {
</span></span></pre></div>
<a id="trunktestsphpunittestsqueryconditionalsphp"></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/query/conditionals.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/conditionals.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/query/conditionals.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,13 +27,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
</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">- function tearDown() {
- global $wp_rewrite;
- $wp_rewrite->init();
-
- parent::tearDown();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> function test_home() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to('/');
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertQueryTrue('is_home');
</span></span></pre></div>
<a id="trunktestsphpunittestsquerysetupPostdataphp"></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/query/setupPostdata.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/setupPostdata.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/query/setupPostdata.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,21 +23,6 @@
</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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function tearDown() {
- parent::tearDown();
- return;
-
- foreach ( $this->global_keys as $global_key ) {
- if ( ! is_null( $this->global_data[ $global_key ] ) ) {
- $GLOBALS[ $global_key ] = $this->global_data[ $global_key ];
- } else {
- unset( $GLOBALS[ $global_key ] );
- }
- }
-
- $this->global_data = array();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> public function test_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $p = self::factory()->post->create_and_get();
</span><span class="cx" style="display: block; padding: 0 10px"> setup_postdata( $p );
</span></span></pre></div>
<a id="trunktestsphpunittestsshortcodephp"></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/shortcode.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/shortcode.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/shortcode.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,8 +20,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function tearDown() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $shortcode_tags;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( $this->shortcodes as $shortcode )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( $this->shortcodes as $shortcode ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> unset( $shortcode_tags[ $shortcode ] );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> parent::tearDown();
</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="trunktestsphpunitteststermslashesphp"></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/slashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/slashes.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/term/slashes.php 2015-10-17 19:24:20 UTC (rev 35244)
</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 setUp() {
</span><span class="cx" style="display: block; padding: 0 10px"> parent::setUp();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->author_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->old_current_user = get_current_user_id();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $this->author_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->slash_1 = 'String with 1 slash \\';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,11 +21,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
</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">- function tearDown() {
- wp_set_current_user( $this->old_current_user );
- parent::tearDown();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Tests the model function that expects slashed data
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="trunktestsphpunitteststermphp"></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.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/term.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,7 +12,9 @@
</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 static function wpTearDownAfterClass() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- array_map( 'wp_delete_post', self::$post_ids );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( self::$post_ids as $post_id ) {
+ wp_delete_post( $post_id, true );
+ }
</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="trunktestsphpunittestsusercountUserPostsphp"></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/user/countUserPosts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/countUserPosts.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/user/countUserPosts.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,10 +27,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_author' => 12345,
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_type' => 'wptests_pt',
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self::$post_ids = array_merge( self::$post_ids, $factory->post->create_many( 1, array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ self::$post_ids[] = $factory->post->create( array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'post_author' => 12345,
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_type' => 'wptests_pt',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ) );
</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 static function wpTearDownAfterClass() {
</span></span></pre></div>
<a id="trunktestsphpunittestsuserlistAuthorsphp"></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/user/listAuthors.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/listAuthors.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/user/listAuthors.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,7 +4,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @group user
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_User_ListAuthors extends WP_UnitTestCase {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- static $users = array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ static $user_ids = array();
</ins><span class="cx" style="display: block; padding: 0 10px"> static $fred_id;
</span><span class="cx" style="display: block; padding: 0 10px"> static $posts = array();
</span><span class="cx" style="display: block; padding: 0 10px"> static $user_urls = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,13 +24,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'html' => true );
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function wpSetUpBeforeClass( $factory ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self::$users[] = $factory->user->create( array( 'user_login' => 'zack', 'display_name' => 'zack', 'role' => 'author', 'first_name' => 'zack', 'last_name' => 'moon' ) );
- self::$users[] = $factory->user->create( array( 'user_login' => 'bob', 'display_name' => 'bob', 'role' => 'author', 'first_name' => 'bob', 'last_name' => 'reno' ) );
- self::$users[] = $factory->user->create( array( 'user_login' => 'paul', 'display_name' => 'paul', 'role' => 'author', 'first_name' => 'paul', 'last_name' => 'norris' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self::$user_ids[] = $factory->user->create( array( 'user_login' => 'zack', 'display_name' => 'zack', 'role' => 'author', 'first_name' => 'zack', 'last_name' => 'moon' ) );
+ self::$user_ids[] = $factory->user->create( array( 'user_login' => 'bob', 'display_name' => 'bob', 'role' => 'author', 'first_name' => 'bob', 'last_name' => 'reno' ) );
+ self::$user_ids[] = $factory->user->create( array( 'user_login' => 'paul', 'display_name' => 'paul', 'role' => 'author', 'first_name' => 'paul', 'last_name' => 'norris' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> self::$fred_id = $factory->user->create( array( 'user_login' => 'fred', 'role' => 'author' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $count = 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( self::$users as $userid ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( self::$user_ids as $userid ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $count = $count + 1;
</span><span class="cx" style="display: block; padding: 0 10px"> for ( $i = 0; $i < $count; $i++ ) {
</span><span class="cx" style="display: block; padding: 0 10px"> self::$posts[] = $factory->post->create( array( 'post_type' => 'post', 'post_author' => $userid ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,7 +41,9 @@
</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 static function wpTearDownAfterClass() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( array_merge( self::$users, array( self::$fred_id ) ) as $user_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self::$user_ids[] = self::$fred_id;
+
+ foreach ( self::$user_ids as $user_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> self::delete_user( $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">@@ -96,17 +98,17 @@
</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_wp_list_authors_feed() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url0 = get_author_feed_link( self::$users[0] );
- $url1 = get_author_feed_link( self::$users[1] );
- $url2 = get_author_feed_link( self::$users[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url0 = get_author_feed_link( self::$user_ids[0] );
+ $url1 = get_author_feed_link( self::$user_ids[1] );
+ $url2 = get_author_feed_link( self::$user_ids[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected['feed'] = '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a> (<a href="' . $url1 . '">link to feed</a>)</li><li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a> (<a href="' . $url2 . '">link to feed</a>)</li><li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a> (<a href="' . $url0 . '">link to feed</a>)</li>';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->AssertEquals( $expected['feed'], wp_list_authors( array( 'echo' => false, 'feed' => 'link to feed' ) ) );
</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_wp_list_authors_feed_image() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url0 = get_author_feed_link( self::$users[0] );
- $url1 = get_author_feed_link( self::$users[1] );
- $url2 = get_author_feed_link( self::$users[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url0 = get_author_feed_link( self::$user_ids[0] );
+ $url1 = get_author_feed_link( self::$user_ids[1] );
+ $url2 = get_author_feed_link( self::$user_ids[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected['feed_image'] = '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a> <a href="' . $url1 . '"><img src="http://' . WP_TESTS_DOMAIN . '/path/to/a/graphic.png" style="border: none;" /></a></li><li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a> <a href="' . $url2 . '"><img src="http://' . WP_TESTS_DOMAIN . '/path/to/a/graphic.png" style="border: none;" /></a></li><li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a> <a href="' . $url0 . '"><img src="http://' . WP_TESTS_DOMAIN . '/path/to/a/graphic.png" style="border: none;" /></a></li>';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->AssertEquals( $expected['feed_image'], wp_list_authors( array( 'echo' => false, 'feed_image' => WP_TESTS_DOMAIN . '/path/to/a/graphic.png' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,9 +117,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 26538
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_authors_feed_type() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url0 = get_author_feed_link( self::$users[0], 'atom' );
- $url1 = get_author_feed_link( self::$users[1], 'atom' );
- $url2 = get_author_feed_link( self::$users[2], 'atom' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url0 = get_author_feed_link( self::$user_ids[0], 'atom' );
+ $url1 = get_author_feed_link( self::$user_ids[1], 'atom' );
+ $url2 = get_author_feed_link( self::$user_ids[2], 'atom' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected['feed_type'] = '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a> (<a href="' . $url1 . '">link to feed</a>)</li><li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a> (<a href="' . $url2 . '">link to feed</a>)</li><li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a> (<a href="' . $url0 . '">link to feed</a>)</li>';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->AssertEquals( $expected['feed_type'], wp_list_authors( array( 'echo' => false, 'feed' => 'link to feed', 'feed_type' => 'atom' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsuserqueryphp"></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/user/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/query.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/user/query.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -932,6 +932,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_single_role_by_string_which_is_similar() {
</span><span class="cx" style="display: block; padding: 0 10px"> $another_editor = self::factory()->user->create( array(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'user_email' => 'another_editor@another_editor.com',
+ 'user_login' => 'another_editor',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'role' => 'another-editor',
</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="trunktestsphpunittestsuserslashesphp"></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/user/slashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/slashes.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/user/slashes.php 2015-10-17 19:24:20 UTC (rev 35244)
</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 setUp() {
</span><span class="cx" style="display: block; padding: 0 10px"> parent::setUp();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->author_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->old_current_user = get_current_user_id();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $this->author_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // it is important to test with both even and odd numbered slashes as
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,11 +23,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
</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">- function tearDown() {
- wp_set_current_user( $this->old_current_user );
- parent::tearDown();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Tests the controller function that expects slashed data
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="trunktestsphpunittestsuserphp"></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/user.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user.php 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/user.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,7 +244,11 @@
</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"> foreach ( $roles as $role => $level ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $user_id = self::factory()->user->create( array( 'role' => $role ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_id = self::factory()->user->create( array(
+ 'user_email' => 'user_19265_' . $role . '@burritos.com',
+ 'user_login' => 'user_19265_' . $role,
+ 'role' => $role
+ ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $user->user_level ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -775,6 +779,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'user_nicename' => str_repeat( 'a', 50 ),
</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">+ $user1 = new WP_User( $u1 );
+
+ $expected = str_repeat( 'a', 50 );
+ $this->assertSame( $expected, $user1->user_nicename );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $user_login = str_repeat( 'a', 55 );
</span><span class="cx" style="display: block; padding: 0 10px"> $u = wp_insert_user( array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'user_login' => $user_login,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -783,19 +792,29 @@
</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"> $this->assertNotEmpty( $u );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $user = new WP_User( $u );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user2 = new WP_User( $u );
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected = str_repeat( 'a', 48 ) . '-2';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( $expected, $user->user_nicename );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $user2->user_nicename );
</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 class="cx" style="display: block; padding: 0 10px"> * @ticket 33793
</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_user_should_not_truncate_to_a_duplicate_user_nicename_when_suffix_has_more_than_one_character() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $users = self::factory()->user->create_many( 4, array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_ids = self::factory()->user->create_many( 4, array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'user_nicename' => str_repeat( 'a', 50 ),
</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">+ foreach ( $user_ids as $i => $user_id ) {
+ $user = new WP_User( $user_id );
+ if ( 0 === $i ) {
+ $expected = str_repeat( 'a', 50 );
+ } else {
+ $expected = str_repeat( 'a', 48 ) . '-' . ( $i + 1 );
+ }
+ $this->assertSame( $expected, $user->user_nicename );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $user_login = str_repeat( 'a', 55 );
</span><span class="cx" style="display: block; padding: 0 10px"> $u = wp_insert_user( array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'user_login' => $user_login,
</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 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php 2015-10-17 19:24:20 UTC (rev 35244)
</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"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_no_editable_posts() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_delete_post( $this->post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_delete_post( $this->post_id, true );
</ins><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><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotInstanceOf( 'IXR_Error', $result );
</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 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPage.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,11 +23,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->post_id = wp_insert_post( $this->post_data );
</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">- function tearDown() {
- wp_delete_post( $this->post_id );
- parent::tearDown();
- }
-
</del><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, $this->post_id, 'username', 'password' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Error', $result );
</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 2015-10-17 18:29:32 UTC (rev 35243)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getUser.php 2015-10-17 19:24:20 UTC (rev 35244)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,9 +17,9 @@
</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 tearDown() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_multisite() )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_multisite() ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> revoke_super_admin( $this->administrator_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> parent::tearDown();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>