From 3785439c8bf01ad18727433f3586dc2cbf641e2a Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 2 Jul 2020 18:21:43 +0000 Subject: [PATCH] Tests: Further fix some issues with indeterminate sort ordering in `Tests_List_Pages`: * Make sure `test_wp_list_pages_number()` sorts by ID, as there are several pages with the same title. * Limit `test_wp_list_pages_sort_column()` to one level, as the child page fixtures don't have an author and cannot be reliably sorted by `post_author`. Follow-up to [48157]. Props afercia. See #50466. git-svn-id: https://develop.svn.wordpress.org/trunk@48280 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/post/listPages.php | 32 +++++++------------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/tests/phpunit/tests/post/listPages.php b/tests/phpunit/tests/post/listPages.php index 86805a226e..f5bee299a3 100644 --- a/tests/phpunit/tests/post/listPages.php +++ b/tests/phpunit/tests/post/listPages.php @@ -296,11 +296,12 @@ class Tests_List_Pages extends WP_UnitTestCase { function test_wp_list_pages_number() { $args = array( - 'echo' => false, - 'number' => 1, + 'echo' => false, + 'number' => 1, + 'sort_column' => 'ID', ); - $expected = '