Changeset 60253 for trunk/tests/phpunit/tests/admin/includesTemplate.php
- Timestamp:
- 05/26/2025 02:34:12 PM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesTemplate.php
r59564 r60253 4 4 */ 5 5 class Tests_Admin_IncludesTemplate extends WP_UnitTestCase { 6 /** 7 * Editor user ID. 8 * 9 * @var int $editor_id 10 */ 11 public static $editor_id; 12 13 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 14 self::$editor_id = $factory->user->create( array( 'role' => 'editor' ) ); 15 } 6 16 7 17 /** … … 65 75 66 76 // Test that get_inline_data() has `post_category` div containing the assigned term. 67 wp_set_current_user( self:: factory()->user->create( array( 'role' => 'editor' ) ));77 wp_set_current_user( self::$editor_id ); 68 78 get_inline_data( $post ); 69 79 $this->expectOutputRegex( '/<div class="post_category" id="wptests_tax_1_' . $post->ID . '">' . $term['term_id'] . '<\/div>/' ); … … 91 101 92 102 // Test that get_inline_data() has `tags_input` div containing the assigned term. 93 wp_set_current_user( self:: factory()->user->create( array( 'role' => 'editor' ) ));103 wp_set_current_user( self::$editor_id ); 94 104 get_inline_data( $post ); 95 105 $this->expectOutputRegex( '/<div class="tags_input" id="wptests_tax_1_' . $post->ID . '">Test<\/div>/' );
Note: See TracChangeset
for help on using the changeset viewer.