Changeset 60253 for trunk/tests/phpunit/tests/taxonomy.php
- Timestamp:
- 05/26/2025 02:34:12 PM (6 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/taxonomy.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/taxonomy.php
r60251 r60253 5 5 */ 6 6 class Tests_Taxonomy extends WP_UnitTestCase { 7 8 /** 9 * Editor user ID. 10 * 11 * @var int $editor_id 12 */ 13 public static $editor_id; 14 15 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 16 self::$editor_id = $factory->user->create( array( 'role' => 'editor' ) ); 17 } 18 7 19 public function test_get_post_taxonomies() { 8 20 $this->assertSame( array( 'category', 'post_tag', 'post_format' ), get_object_taxonomies( 'post' ) ); … … 1011 1023 ); 1012 1024 1013 wp_set_current_user( self:: factory()->user->create( array( 'role' => 'editor' ) ));1025 wp_set_current_user( self::$editor_id ); 1014 1026 $updated_post_id = edit_post( 1015 1027 array( … … 1037 1049 public function test_default_term_for_custom_taxonomy() { 1038 1050 1039 wp_set_current_user( self:: factory()->user->create( array( 'role' => 'editor' ) ));1051 wp_set_current_user( self::$editor_id ); 1040 1052 1041 1053 $tax = 'custom-tax';
Note: See TracChangeset
for help on using the changeset viewer.