Changeset 60253 for trunk/tests/phpunit/tests/post/getPages.php
- Timestamp:
- 05/26/2025 02:34:12 PM (8 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post/getPages.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/getPages.php
r56746 r60253 7 7 */ 8 8 class Tests_Post_GetPages extends WP_UnitTestCase { 9 10 /** 11 * ID of the first author. 12 * 13 * @var int 14 */ 15 public static $author_id_1; 16 17 /** 18 * ID of the second author. 19 * 20 * @var int 21 */ 22 public static $author_id_2; 23 24 /** 25 * Set up the shared fixture. 26 * 27 * @param WP_UnitTest_Factory $factory Factory instance. 28 */ 29 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 30 self::$author_id_1 = $factory->user->create( 31 array( 32 'user_login' => 'author1', 33 'role' => 'author', 34 ) 35 ); 36 37 self::$author_id_2 = $factory->user->create( 38 array( 39 'user_login' => 'author2', 40 'role' => 'author', 41 ) 42 ); 43 } 44 9 45 /** 10 46 * @ticket 23167 … … 964 1000 */ 965 1001 public function test_get_pages_author() { 966 $author_1 = self::factory()->user->create( 967 array( 968 'user_login' => 'author1', 969 'role' => 'author', 970 ) 971 ); 1002 $author_1 = self::$author_id_1; 972 1003 $posts = self::factory()->post->create_many( 973 1004 2, … … 990 1021 */ 991 1022 public function test_get_pages_multiple_authors() { 992 $author_1 = self::factory()->user->create( 993 array( 994 'user_login' => 'author1', 995 'role' => 'author', 996 ) 997 ); 1023 $author_1 = self::$author_id_1; 998 1024 $post_1 = self::factory()->post->create( 999 1025 array( … … 1005 1031 ); 1006 1032 1007 $author_2 = self::factory()->user->create( 1008 array( 1009 'user_login' => 'author2', 1010 'role' => 'author', 1011 ) 1012 ); 1033 $author_2 = self::$author_id_2; 1013 1034 $post_2 = self::factory()->post->create( 1014 1035 array( … … 1032 1053 */ 1033 1054 public function test_get_pages_multiple_authors_by_user_login() { 1034 $author_1 = self::factory()->user->create( 1035 array( 1036 'user_login' => 'author1', 1037 'role' => 'author', 1038 ) 1039 ); 1055 $author_1 = self::$author_id_1; 1040 1056 $post_1 = self::factory()->post->create( 1041 1057 array( … … 1047 1063 ); 1048 1064 1049 $author_2 = self::factory()->user->create( 1050 array( 1051 'user_login' => 'author2', 1052 'role' => 'author', 1053 ) 1054 ); 1065 $author_2 = self::$author_id_2; 1055 1066 $post_2 = self::factory()->post->create( 1056 1067 array(
Note: See TracChangeset
for help on using the changeset viewer.