diff --git a/tests/phpunit/tests/post/listPages.php b/tests/phpunit/tests/post/listPages.php index d2146312dd..a550c389ed 100644 --- a/tests/phpunit/tests/post/listPages.php +++ b/tests/phpunit/tests/post/listPages.php @@ -3,6 +3,8 @@ class Tests_List_Pages extends WP_UnitTestCase { var $pages; + protected $time = null; + /* $defaults = array( 'depth' => 0, @@ -27,16 +29,18 @@ class Tests_List_Pages extends WP_UnitTestCase { parent::setUp(); global $wpdb; $wpdb->query( 'TRUNCATE ' . $wpdb->prefix . 'posts' ); + $this->time = time(); + $post_date = date( 'Y-m-d H:i:s', $this->time ); $pages = array(); self::factory()->user->create(); - $pages[] = self::factory()->post->create( array( 'post_type' => 'page', 'post_title' => 'Parent 1' ) ); - $pages[] = self::factory()->post->create( array( 'post_type' => 'page', 'post_title' => 'Parent 2' ) ); - $pages[] = self::factory()->post->create( array( 'post_type' => 'page', 'post_title' => 'Parent 3', 'post_author' => '2' ) ); + $pages[] = self::factory()->post->create( array( 'post_type' => 'page', 'post_title' => 'Parent 1', 'post_date' => $post_date ) ); + $pages[] = self::factory()->post->create( array( 'post_type' => 'page', 'post_title' => 'Parent 2', 'post_date' => $post_date ) ); + $pages[] = self::factory()->post->create( array( 'post_type' => 'page', 'post_title' => 'Parent 3', 'post_author' => '2', 'post_date' => $post_date ) ); foreach ( $pages as $page ) { - $this->pages[$page] = self::factory()->post->create( array( 'post_parent' => $page, 'post_type' => 'page', 'post_title' => 'Child 1' ) ); - $this->pages[$page] = self::factory()->post->create( array( 'post_parent' => $page, 'post_type' => 'page', 'post_title' => 'Child 2' ) ); - $this->pages[$page] = self::factory()->post->create( array( 'post_parent' => $page, 'post_type' => 'page', 'post_title' => 'Child 3' ) ); + $this->pages[$page] = self::factory()->post->create( array( 'post_parent' => $page, 'post_type' => 'page', 'post_title' => 'Child 1', 'post_date' => $post_date ) ); + $this->pages[$page] = self::factory()->post->create( array( 'post_parent' => $page, 'post_type' => 'page', 'post_title' => 'Child 2', 'post_date' => $post_date ) ); + $this->pages[$page] = self::factory()->post->create( array( 'post_parent' => $page, 'post_type' => 'page', 'post_title' => 'Child 3', 'post_date' => $post_date ) ); } } @@ -89,9 +93,10 @@ class Tests_List_Pages extends WP_UnitTestCase { 'depth' => 1, 'show_date' => true ); - $expected['show_date'] = '