From 07e3dda9ba5963be82676f357f6f96ad7ae03f3d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 24 Jun 2020 15:00:43 +0000 Subject: [PATCH] Tests: Add a post author to "Parent 1" page fixture in `tests/post/listPages.php`. This avoids indeterminate ordering in `test_wp_list_pages_sort_column()`. Fixes #50466. git-svn-id: https://develop.svn.wordpress.org/trunk@48157 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/post/listPages.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/tests/post/listPages.php b/tests/phpunit/tests/post/listPages.php index 01efc5157d..29d54f2f34 100644 --- a/tests/phpunit/tests/post/listPages.php +++ b/tests/phpunit/tests/post/listPages.php @@ -4,6 +4,13 @@ * @group post */ class Tests_List_Pages extends WP_UnitTestCase { + /** + * Editor user id. + * + * @var int + */ + public static $editor; + /** * Author user id. * @@ -51,16 +58,18 @@ class Tests_List_Pages extends WP_UnitTestCase { $post_date = gmdate( 'Y-m-d H:i:s', self::$time ); + self::$editor = self::factory()->user->create( array( 'role' => 'editor' ) ); + self::$author = self::factory()->user->create( array( 'role' => 'author' ) ); + self::$parent_1 = self::factory()->post->create( array( - 'post_type' => 'page', - 'post_title' => 'Parent 1', - 'post_date' => $post_date, + 'post_author' => self::$editor, + 'post_type' => 'page', + 'post_title' => 'Parent 1', + 'post_date' => $post_date, ) ); - self::$author = self::factory()->user->create( array( 'role' => 'author' ) ); - self::$parent_2 = self::factory()->post->create( array( 'post_type' => 'page',