Make WordPress Core

Changeset 48157


Ignore:
Timestamp:
06/24/2020 03:00:43 PM (6 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/listPages.php

    r46612 r48157  
    66class Tests_List_Pages extends WP_UnitTestCase {
    77        /**
     8         * Editor user id.
     9         *
     10         * @var int
     11         */
     12        public static $editor;
     13
     14        /**
    815         * Author user id.
    916         *
     
    5259                $post_date = gmdate( 'Y-m-d H:i:s', self::$time );
    5360
     61                self::$editor = self::factory()->user->create( array( 'role' => 'editor' ) );
     62                self::$author = self::factory()->user->create( array( 'role' => 'author' ) );
     63
    5464                self::$parent_1 = self::factory()->post->create(
    5565                        array(
    56                                 'post_type'  => 'page',
    57                                 'post_title' => 'Parent 1',
    58                                 'post_date'  => $post_date,
     66                                'post_author' => self::$editor,
     67                                'post_type'   => 'page',
     68                                'post_title'  => 'Parent 1',
     69                                'post_date'   => $post_date,
    5970                        )
    6071                );
    61 
    62                 self::$author = self::factory()->user->create( array( 'role' => 'author' ) );
    6372
    6473                self::$parent_2 = self::factory()->post->create(
Note: See TracChangeset for help on using the changeset viewer.