<!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>[35162] trunk/tests/phpunit/tests: Create fewer fixtures in some tests.</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/35162">35162</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/35162","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>boonebgorges</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-10-14 21:23:03 +0000 (Wed, 14 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'>Create fewer fixtures in some tests.

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="#trunktestsphpunittestscategoryphp">trunk/tests/phpunit/tests/category.php</a></li>
<li><a href="#trunktestsphpunittestscustomizenavmenusphp">trunk/tests/phpunit/tests/customize/nav-menus.php</a></li>
<li><a href="#trunktestsphpunittestsfeedrss2php">trunk/tests/phpunit/tests/feed/rss2.php</a></li>
<li><a href="#trunktestsphpunittestsgeneralarchivesphp">trunk/tests/phpunit/tests/general/archives.php</a></li>
<li><a href="#trunktestsphpunittestspostgetPagesphp">trunk/tests/phpunit/tests/post/getPages.php</a></li>
<li><a href="#trunktestsphpunittestspostqueryphp">trunk/tests/phpunit/tests/post/query.php</a></li>
<li><a href="#trunktestsphpunittestspostphp">trunk/tests/phpunit/tests/post.php</a></li>
<li><a href="#trunktestsphpunittestsqueryconditionalsphp">trunk/tests/phpunit/tests/query/conditionals.php</a></li>
<li><a href="#trunktestsphpunittestsquerytaxQueryphp">trunk/tests/phpunit/tests/query/taxQuery.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsphpunittestscategoryphp"></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/category.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/category.php    2015-10-14 18:57:16 UTC (rev 35161)
+++ trunk/tests/phpunit/tests/category.php      2015-10-14 21:23:03 UTC (rev 35162)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,17 +21,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        function test_get_all_category_ids() {
</span><span class="cx" style="display: block; padding: 0 10px">                // create categories
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->category->create_many(15);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->factory->category->create_many( 2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // create new taxonomy to ensure not included
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'test_tax_cat', 'post' );
</span><span class="cx" style="display: block; padding: 0 10px">                wp_insert_term( "test1", 'test_tax_cat' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                wp_insert_term( "test2", 'test_tax_cat' );
-               wp_insert_term( "test3", 'test_tax_cat' );
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Validate length is 1 + created due to uncategorized
</span><span class="cx" style="display: block; padding: 0 10px">                $cat_ids = get_all_category_ids();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->assertEquals( 16, count($cat_ids));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->assertEquals( 3, count($cat_ids));
</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="trunktestsphpunittestscustomizenavmenusphp"></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/customize/nav-menus.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/nav-menus.php 2015-10-14 18:57:16 UTC (rev 35161)
+++ trunk/tests/phpunit/tests/customize/nav-menus.php   2015-10-14 21:23:03 UTC (rev 35162)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -124,7 +124,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">                // Create pages.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create_many( 15, array( 'post_type' => 'page' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->factory->post->create_many( 12, array( 'post_type' => 'page' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Home is included in menu items when page is zero.
</span><span class="cx" style="display: block; padding: 0 10px">                $items = $menus->load_available_items_query( 'post_type', 'page', 0 );
</span></span></pre></div>
<a id="trunktestsphpunittestsfeedrss2php"></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/feed/rss2.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/feed/rss2.php   2015-10-14 18:57:16 UTC (rev 35161)
+++ trunk/tests/phpunit/tests/feed/rss2.php     2015-10-14 21:23:03 UTC (rev 35162)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $factory = new WP_UnitTest_Factory();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                self::$user = $factory->user->create();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                self::$posts = $factory->post->create_many( 25, array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::$posts = $factory->post->create_many( 5, array(
</ins><span class="cx" style="display: block; padding: 0 10px">                         'post_author' => self::$user,
</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="trunktestsphpunittestsgeneralarchivesphp"></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/archives.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/general/archives.php    2015-10-14 18:57:16 UTC (rev 35161)
+++ trunk/tests/phpunit/tests/general/archives.php      2015-10-14 21:23:03 UTC (rev 35162)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        function test_get_archives_cache() {
</span><span class="cx" style="display: block; padding: 0 10px">                global $wpdb;
</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->factory->post->create_many( 15, array( 'post_type' => 'post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->factory->post->create_many( 3, array( 'post_type' => 'post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_cache_delete( 'last_changed', 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertFalse( wp_cache_get( 'last_changed', 'posts' ) );
</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-14 18:57:16 UTC (rev 35161)
+++ trunk/tests/phpunit/tests/post/getPages.php 2015-10-14 21:23:03 UTC (rev 35162)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,12 +15,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">        function test_get_pages_cache() {
</span><span class="cx" style="display: block; padding: 0 10px">                global $wpdb;
</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->factory->post->create_many( 15, array( 'post_type' => 'page' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->factory->post->create_many( 3, array( 'post_type' => 'page' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_cache_delete( 'last_changed', 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertFalse( 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">                $pages = get_pages();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->assertEquals( 15, count( $pages ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->assertEquals( 3, count( $pages ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assertNotEmpty( $time1 = wp_cache_get( 'last_changed', 'posts' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $pages as $page )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,7 +28,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Again. num_queries and last_changed should remain the same.
</span><span class="cx" style="display: block; padding: 0 10px">                $pages = get_pages();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->assertEquals( 15, count( $pages ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->assertEquals( 3, count( $pages ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertEquals( $num_queries, $wpdb->num_queries );
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $pages as $page )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,8 +36,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Again with different args. last_changed should not increment because of
</span><span class="cx" style="display: block; padding: 0 10px">                // different args to get_pages(). num_queries should bump by 1.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $pages = get_pages( array( 'number' => 10 ) );
-               $this->assertEquals( 10, count( $pages ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $pages = get_pages( array( 'number' => 2 ) );
+               $this->assertEquals( 2, count( $pages ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $pages as $page )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,8 +46,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Again. num_queries and last_changed should remain the same.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $pages = get_pages( array( 'number' => 10 ) );
-               $this->assertEquals( 10, count( $pages ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $pages = get_pages( array( 'number' => 2 ) );
+               $this->assertEquals( 2, count( $pages ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertEquals( $num_queries, $wpdb->num_queries );
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $pages as $page )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,7 +55,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Do the first query again. The interim queries should not affect it.
</span><span class="cx" style="display: block; padding: 0 10px">                $pages = get_pages();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->assertEquals( 15, count( $pages ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->assertEquals( 3, count( $pages ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertEquals( $num_queries, $wpdb->num_queries );
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $pages as $page )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,8 +68,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // last_changed bumped so num_queries should increment.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $pages = get_pages( array( 'number' => 10 ) );
-               $this->assertEquals( 10, count( $pages ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $pages = get_pages( array( 'number' => 2 ) );
+               $this->assertEquals( 2, count( $pages ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assertEquals( $time2, wp_cache_get( 'last_changed', 'posts' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $pages as $page )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,7 +88,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // num_queries should bump after wp_delete_post() bumps last_changed.
</span><span class="cx" style="display: block; padding: 0 10px">                $pages = get_pages();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->assertEquals( 14, count( $pages ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->assertEquals( 2, count( $pages ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assertEquals( $last_changed, wp_cache_get( 'last_changed', 'posts' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $pages as $page )
</span></span></pre></div>
<a id="trunktestsphpunittestspostqueryphp"></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/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/query.php  2015-10-14 18:57:16 UTC (rev 35161)
+++ trunk/tests/phpunit/tests/post/query.php    2015-10-14 21:23:03 UTC (rev 35162)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        function test_the_posts_filter() {
</span><span class="cx" style="display: block; padding: 0 10px">                // Create posts and clear their caches.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_ids = $this->factory->post->create_many( 10 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_ids = $this->factory->post->create_many( 4 );
</ins><span class="cx" style="display: block; padding: 0 10px">                 foreach ( $post_ids as $post_id )
</span><span class="cx" style="display: block; padding: 0 10px">                        clean_post_cache( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,12 +79,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $query = new WP_Query( array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'post_type' => 'post',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'posts_per_page' => 5,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'posts_per_page' => 3,
</ins><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">-                // Sixth post added in filter
-               $this->assertEquals( 6, count( $query->posts ) );
-               $this->assertEquals( 6, $query->post_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         // Fourth post added in filter
+               $this->assertEquals( 4, count( $query->posts ) );
+               $this->assertEquals( 4, $query->post_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $query->posts as $post ) {
</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        2015-10-14 18:57:16 UTC (rev 35161)
+++ trunk/tests/phpunit/tests/post.php  2015-10-14 21:23:03 UTC (rev 35162)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -804,27 +804,27 @@
</span><span class="cx" style="display: block; padding: 0 10px">        function test_wp_count_posts_filtered() {
</span><span class="cx" style="display: block; padding: 0 10px">                $post_type = rand_str(20);
</span><span class="cx" style="display: block; padding: 0 10px">                register_post_type( $post_type );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create_many( 10, array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->factory->post->create_many( 3, array(
</ins><span class="cx" style="display: block; padding: 0 10px">                         'post_type' => $post_type,
</span><span class="cx" style="display: block; padding: 0 10px">                        'post_author' => $this->author_id
</span><span class="cx" style="display: block; padding: 0 10px">                ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $count1 = wp_count_posts( $post_type, 'readable' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->assertEquals( 10, $count1->publish );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->assertEquals( 3, $count1->publish );
</ins><span class="cx" style="display: block; padding: 0 10px">                 add_filter( 'wp_count_posts', array( $this, 'filter_wp_count_posts' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $count2 = wp_count_posts( $post_type, 'readable' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->assertEquals( 7, $count2->publish );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->assertEquals( 2, $count2->publish );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                remove_filter( 'wp_count_posts', array( $this, 'filter_wp_count_posts' ) );
</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 filter_wp_count_posts( $counts ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $counts->publish = 7;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $counts->publish = 2;
</ins><span class="cx" style="display: block; padding: 0 10px">                 return $counts;
</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_count_posts_insert_invalidation() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_ids = $this->factory->post->create_many( 10 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_ids = $this->factory->post->create_many( 3 );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $initial_counts = wp_count_posts();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $key = array_rand( $post_ids );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -837,12 +837,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $after_draft_counts = wp_count_posts();
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertEquals( 1, $after_draft_counts->draft );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->assertEquals( 9, $after_draft_counts->publish );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->assertEquals( 2, $after_draft_counts->publish );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assertNotEquals( $initial_counts->publish, $after_draft_counts->publish );
</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_count_posts_trash_invalidation() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_ids = $this->factory->post->create_many( 10 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_ids = $this->factory->post->create_many( 3 );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $initial_counts = wp_count_posts();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $key = array_rand( $post_ids );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -855,7 +855,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $after_trash_counts = wp_count_posts();
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertEquals( 1, $after_trash_counts->trash );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->assertEquals( 9, $after_trash_counts->publish );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->assertEquals( 2, $after_trash_counts->publish );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assertNotEquals( $initial_counts->publish, $after_trash_counts->publish );
</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="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-14 18:57:16 UTC (rev 35161)
+++ trunk/tests/phpunit/tests/query/conditionals.php    2015-10-14 21:23:03 UTC (rev 35162)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -251,7 +251,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // 'page/?([0-9]{1,})/?$' => 'index.php?&paged=$matches[1]',
</span><span class="cx" style="display: block; padding: 0 10px">        function test_paged() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create_many( 15 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         update_option( 'posts_per_page', 2 );
+               $this->factory->post->create_many( 5 );
</ins><span class="cx" style="display: block; padding: 0 10px">                 for ( $i = 2; $i <= 3; $i++ ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->go_to("/page/{$i}/");
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->assertQueryTrue('is_home', 'is_paged');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -304,7 +305,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // 'search/(.+)/page/?([0-9]{1,})/?$' => 'index.php?s=$matches[1]&paged=$matches[2]',
</span><span class="cx" style="display: block; padding: 0 10px">        function test_search_paged() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create_many( 10, array( 'post_title' => 'test' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         update_option( 'posts_per_page', 2 );
+               $this->factory->post->create_many( 3, array( 'post_title' => 'test' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->go_to('/search/test/page/2/');
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertQueryTrue('is_search', 'is_paged');
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -344,7 +346,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // 'category/(.+?)/page/?([0-9]{1,})/?$' => 'index.php?category_name=$matches[1]&paged=$matches[2]',
</span><span class="cx" style="display: block; padding: 0 10px">        function test_category_paged() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create_many( 10 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         update_option( 'posts_per_page', 2 );
+               $this->factory->post->create_many( 3 );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->go_to('/category/uncategorized/page/2/');
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertQueryTrue('is_archive', 'is_category', 'is_paged');
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -377,7 +380,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // 'tag/(.+?)/page/?([0-9]{1,})/?$' => 'index.php?tag=$matches[1]&paged=$matches[2]',
</span><span class="cx" style="display: block; padding: 0 10px">        function test_tag_paged() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_ids = $this->factory->post->create_many( 10 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         update_option( 'posts_per_page', 2 );
+               $post_ids = $this->factory->post->create_many( 3 );
</ins><span class="cx" style="display: block; padding: 0 10px">                 foreach ( $post_ids as $post_id )
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->factory->term->add_post_terms( $post_id, 'tag-a', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->go_to('/tag/tag-a/page/2/');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -423,8 +427,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // 'author/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?author_name=$matches[1]&paged=$matches[2]',
</span><span class="cx" style="display: block; padding: 0 10px">        function test_author_paged() {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                update_option( 'posts_per_page', 2 );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $user_id = $this->factory->user->create( array( 'user_login' => 'user-a' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create_many( 10, array( 'post_author' => $user_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->factory->post->create_many( 3, array( 'post_author' => $user_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->go_to('/author/user-a/page/2/');
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertQueryTrue('is_archive', 'is_author', 'is_paged');
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -464,7 +469,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]',
</span><span class="cx" style="display: block; padding: 0 10px">        function test_ymd_paged() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create_many( 10, array( 'post_date' => '2007-09-04 00:00:00' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         update_option( 'posts_per_page', 2 );
+               $this->factory->post->create_many( 3, array( 'post_date' => '2007-09-04 00:00:00' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->go_to('/2007/09/04/page/2/');
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertQueryTrue('is_archive', 'is_day', 'is_date', 'is_paged');
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -497,7 +503,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // '([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]',
</span><span class="cx" style="display: block; padding: 0 10px">        function test_ym_paged() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create_many( 10, array( 'post_date' => '2007-09-04 00:00:00' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         update_option( 'posts_per_page', 2 );
+               $this->factory->post->create_many( 3, array( 'post_date' => '2007-09-04 00:00:00' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->go_to('/2007/09/page/2/');
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertQueryTrue('is_archive', 'is_date', 'is_month', 'is_paged');
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -530,7 +537,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // '([0-9]{4})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&paged=$matches[2]',
</span><span class="cx" style="display: block; padding: 0 10px">        function test_y_paged() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create_many( 10, array( 'post_date' => '2007-09-04 00:00:00' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         update_option( 'posts_per_page', 2 );
+               $this->factory->post->create_many( 3, array( 'post_date' => '2007-09-04 00:00:00' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->go_to('/2007/page/2/');
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertQueryTrue('is_archive', 'is_date', 'is_year', 'is_paged');
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span></span></pre></div>
<a id="trunktestsphpunittestsquerytaxQueryphp"></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/taxQuery.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/taxQuery.php      2015-10-14 18:57:16 UTC (rev 35161)
+++ trunk/tests/phpunit/tests/query/taxQuery.php        2015-10-14 21:23:03 UTC (rev 35162)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -840,7 +840,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_tax_query_relation_or_both_clauses_empty_terms() {
</span><span class="cx" style="display: block; padding: 0 10px">                // An empty tax query should return an empty array, not all posts.
</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->factory->post->create_many( 10 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->factory->post->create_many( 2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $query = new WP_Query( array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'fields' => 'ids',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -873,7 +873,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_tax_query_relation_or_one_clause_empty_terms() {
</span><span class="cx" style="display: block; padding: 0 10px">                // An empty tax query should return an empty array, not all posts.
</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->factory->post->create_many( 10 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->factory->post->create_many( 2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $query = new WP_Query( array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'fields' => 'ids',
</span></span></pre>
</div>
</div>

</body>
</html>