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',