Changeset 60253 for trunk/tests/phpunit/tests/general/template.php
- Timestamp:
- 05/26/2025 02:34:12 PM (7 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/general/template.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/general/template.php
r60062 r60253 33 33 public static $home_page_id; 34 34 35 /** 36 * ID of the administrator user. 37 * 38 * @var int 39 */ 40 public static $administrator_id; 41 42 /** 43 * ID of the author user. 44 * 45 * @var int 46 */ 47 public static $author_id; 48 49 /** 50 * Set up the shared fixtures. 51 * 52 * @param WP_UnitTest_Factory $factory Factory instance. 53 */ 35 54 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 55 self::$administrator_id = $factory->user->create( array( 'role' => 'administrator' ) ); 56 self::$author_id = $factory->user->create( array( 'role' => 'author' ) ); 57 36 58 /* 37 59 * Declare theme support for custom logo. … … 213 235 public function test_customize_preview_wp_site_icon_empty() { 214 236 global $wp_customize; 215 wp_set_current_user( self:: factory()->user->create( array( 'role' => 'administrator' ) ));237 wp_set_current_user( self::$administrator_id ); 216 238 217 239 require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; … … 231 253 public function test_customize_preview_wp_site_icon_dirty() { 232 254 global $wp_customize; 233 wp_set_current_user( self:: factory()->user->create( array( 'role' => 'administrator' ) ));255 wp_set_current_user( self::$administrator_id ); 234 256 235 257 require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; … … 764 786 */ 765 787 public function test_get_the_archive_title_is_correct_for_author_queries() { 766 $user_with_posts = self::factory()->user->create_and_get( 767 array( 768 'role' => 'author', 769 ) 770 ); 771 $user_with_no_posts = self::factory()->user->create_and_get( 772 array( 773 'role' => 'author', 774 ) 775 ); 788 $user_with_posts = get_user_by( 'id', self::$administrator_id ); 789 $user_with_no_posts = get_user_by( 'id', self::$author_id ); 776 790 777 791 self::factory()->post->create(
Note: See TracChangeset
for help on using the changeset viewer.