<!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>[35173] trunk/tests/phpunit/tests/comment.php: Unit Tests: reuse fixtures in `Tests_Comment`.</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/35173">35173</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/35173","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-15 00:38:26 +0000 (Thu, 15 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: reuse fixtures in `Tests_Comment`.

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="#trunktestsphpunittestscommentphp">trunk/tests/phpunit/tests/comment.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<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-15 00:22:50 UTC (rev 35172)
+++ trunk/tests/phpunit/tests/comment.php       2015-10-15 00:38:26 UTC (rev 35173)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,6 +4,22 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @group comment
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Comment extends WP_UnitTestCase {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        protected static $user_id;
+       protected static $post_id;
+
+       public static function setUpBeforeClass() {
+               parent::setUpBeforeClass();
+
+               $factory = new WP_UnitTest_Factory();
+
+               self::$user_id = $factory->user->create();
+               self::$post_id = $factory->post->create( array(
+                       'post_author' => self::$user_id
+               ) );
+
+               self::commit_transaction();
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">         function test_wp_update_comment() {
</span><span class="cx" style="display: block; padding: 0 10px">                $post = $this->factory->post->create_and_get( array( 'post_title' => 'some-post', 'post_type' => 'post' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $post2 = $this->factory->post->create_and_get( array( 'post_title' => 'some-post-2', 'post_type' => 'post' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,8 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 30627
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        function test_wp_update_comment_updates_comment_type() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
-               $comment_id = $this->factory->comment->create( array( 'comment_post_ID' => $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id = $this->factory->comment->create( array( 'comment_post_ID' => self::$post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_update_comment( array( 'comment_ID' => $comment_id, 'comment_type' => 'pingback' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,8 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 30307
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        function test_wp_update_comment_updates_user_id() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
-               $comment_id = $this->factory->comment->create( array( 'comment_post_ID' => $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id = $this->factory->comment->create( array( 'comment_post_ID' => self::$post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_update_comment( array( 'comment_ID' => $comment_id, 'user_id' => 1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,16 +60,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">        public function test_get_approved_comments() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $p = $this->factory->post->create();
-               $ca1 = $this->factory->comment->create( array( 'comment_post_ID' => $p, 'comment_approved' => '1' ) );
-               $ca2 = $this->factory->comment->create( array( 'comment_post_ID' => $p, 'comment_approved' => '1' ) );
-               $ca3 = $this->factory->comment->create( array( 'comment_post_ID' => $p, 'comment_approved' => '0' ) );
-               $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $p, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
-               $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $p, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
-               $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $p, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
-               $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $p, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $ca1 = $this->factory->comment->create( array(
+                       'comment_post_ID' => self::$post_id, 'comment_approved' => '1'
+               ) );
+               $ca2 = $this->factory->comment->create( array(
+                       'comment_post_ID' => self::$post_id, 'comment_approved' => '1'
+               ) );
+               $ca3 = $this->factory->comment->create( array(
+                       'comment_post_ID' => self::$post_id, 'comment_approved' => '0'
+               ) );
+               $c2 = $this->factory->comment->create( array(
+                       'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback'
+               ) );
+               $c3 = $this->factory->comment->create( array(
+                       'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback'
+               ) );
+               $c4 = $this->factory->comment->create( array(
+                       'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario'
+               ) );
+               $c5 = $this->factory->comment->create( array(
+                       'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi'
+               ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $found = get_approved_comments( $p );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $found = get_approved_comments( self::$post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // all comments types will be returned
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertEquals( array( $ca1, $ca2, $c2, $c3, $c4, $c5 ), wp_list_pluck( $found, 'comment_ID' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,8 +92,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 30412
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_approved_comments_with_post_id_0_should_return_empty_array() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $p = $this->factory->post->create();
-               $ca1 = $this->factory->comment->create( array( 'comment_post_ID' => $p, 'comment_approved' => '1' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $ca1 = $this->factory->comment->create( array(
+                       'comment_post_ID' => self::$post_id, 'comment_approved' => '1'
+               ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $found = get_approved_comments( 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,11 +105,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 14279
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_wp_new_comment_respects_dates() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $u = $this->factory->user->create();
-               $post_id = $this->factory->post->create( array( 'post_author' => $u ) );
-
</del><span class="cx" style="display: block; padding: 0 10px">                 $data = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID' => $post_id,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID' => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_author' => rand_str(),
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_url' => '',
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_email' => '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -103,11 +128,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 14601
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_wp_new_comment_respects_author_ip() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $u = $this->factory->user->create();
-               $post_id = $this->factory->post->create( array( 'post_author' => $u ) );
-
</del><span class="cx" style="display: block; padding: 0 10px">                 $data = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID'      => $post_id,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID'      => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_author'       => rand_str(),
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_IP'    => '192.168.1.1',
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_url'   => '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -127,11 +149,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 14601
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_wp_new_comment_respects_author_ip_empty_string() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $u = $this->factory->user->create();
-               $post_id = $this->factory->post->create( array( 'post_author' => $u ) );
-
</del><span class="cx" style="display: block; padding: 0 10px">                 $data = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID'      => $post_id,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID'      => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_author'       => rand_str(),
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_IP'    => '',
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_url'   => '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -151,11 +170,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 14601
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_wp_new_comment_respects_comment_agent() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $u = $this->factory->user->create();
-               $post_id = $this->factory->post->create( array( 'post_author' => $u ) );
-
</del><span class="cx" style="display: block; padding: 0 10px">                 $data = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID'      => $post_id,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID'      => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_author'       => rand_str(),
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_IP'    => '',
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_url'   => '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -176,11 +192,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 14601
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_wp_new_comment_should_trim_provided_comment_agent_to_254_chars() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $u = $this->factory->user->create();
-               $post_id = $this->factory->post->create( array( 'post_author' => $u ) );
-
</del><span class="cx" style="display: block; padding: 0 10px">                 $data = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID'      => $post_id,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID'      => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_author'       => rand_str(),
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_IP'    => '',
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_url'   => '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -201,11 +214,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 14601
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_wp_new_comment_respects_comment_agent_empty_string() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $u = $this->factory->user->create();
-               $post_id = $this->factory->post->create( array( 'post_author' => $u ) );
-
</del><span class="cx" style="display: block; padding: 0 10px">                 $data = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID'      => $post_id,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID'      => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_author'       => rand_str(),
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_IP'    => '',
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_url'   => '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -224,11 +234,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 function test_comment_field_lengths() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $u = $this->factory->user->create();
-               $post_id = $this->factory->post->create( array( 'post_author' => $u ) );
-
</del><span class="cx" style="display: block; padding: 0 10px">                 $data = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID' => $post_id,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID' => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_author' => rand_str(),
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_url' => '',
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author_email' => '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,9 +271,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 33587
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_has_been_marked_as_spam() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $p = $this->factory->post->create();
</del><span class="cx" style="display: block; padding: 0 10px">                 $c = $this->factory->comment->create( array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID' => $p,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID' => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_approved' => 'spam',
</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">@@ -293,39 +299,36 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 8071
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_wp_comment_get_children_should_fill_children() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-               $p = $this->factory->post->create();
-
</del><span class="cx" style="display: block; padding: 0 10px">                 $c1 = $this->factory->comment->create( array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID' => $p,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID' => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_approved' => '1',
</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">                $c2 = $this->factory->comment->create( array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID' => $p,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID' => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_approved' => '1',
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_parent' => $c1,
</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">                $c3 = $this->factory->comment->create( array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID' => $p,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID' => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_approved' => '1',
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_parent' => $c2,
</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">                $c4 = $this->factory->comment->create( array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID' => $p,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID' => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_approved' => '1',
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_parent' => $c1,
</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">                $c5 = $this->factory->comment->create( array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID' => $p,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID' => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_approved' => '1',
</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">                $c6 = $this->factory->comment->create( array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'comment_post_ID' => $p,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'comment_post_ID' => self::$post_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_approved' => '1',
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_parent' => $c5,
</span><span class="cx" style="display: block; padding: 0 10px">                ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -344,11 +347,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @group 27571
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_post_properties_should_be_lazyloaded() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $p = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $c = $this->factory->comment->create( array( 'comment_post_ID' => self::$post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $c = $this->factory->comment->create( array( 'comment_post_ID' => $p ) );
-
-               $post = get_post( $p );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post = get_post( self::$post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $comment = get_comment( $c );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $post_fields = array( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_content_filtered', 'post_parent', 'guid', 'menu_order', 'post_type', 'post_mime_type', 'comment_count' );
</span></span></pre>
</div>
</div>

</body>
</html>