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
This commit is contained in:
parent
b56db034d3
commit
07e3dda9ba
@ -4,6 +4,13 @@
|
|||||||
* @group post
|
* @group post
|
||||||
*/
|
*/
|
||||||
class Tests_List_Pages extends WP_UnitTestCase {
|
class Tests_List_Pages extends WP_UnitTestCase {
|
||||||
|
/**
|
||||||
|
* Editor user id.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public static $editor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author user id.
|
* 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 );
|
$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(
|
self::$parent_1 = self::factory()->post->create(
|
||||||
array(
|
array(
|
||||||
|
'post_author' => self::$editor,
|
||||||
'post_type' => 'page',
|
'post_type' => 'page',
|
||||||
'post_title' => 'Parent 1',
|
'post_title' => 'Parent 1',
|
||||||
'post_date' => $post_date,
|
'post_date' => $post_date,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
self::$author = self::factory()->user->create( array( 'role' => 'author' ) );
|
|
||||||
|
|
||||||
self::$parent_2 = self::factory()->post->create(
|
self::$parent_2 = self::factory()->post->create(
|
||||||
array(
|
array(
|
||||||
'post_type' => 'page',
|
'post_type' => 'page',
|
||||||
|
Loading…
Reference in New Issue
Block a user