Changeset 63776
- Timestamp:
- 09/21/2026 05:45:12 PM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-post-meta-fields.php
r62969 r63776 12 12 protected static $post_id; 13 13 protected static $cpt_post_id; 14 protected static $editor_id; 14 15 15 16 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { … … 25 26 self::$post_id = $factory->post->create(); 26 27 self::$cpt_post_id = $factory->post->create( array( 'post_type' => 'cpt' ) ); 28 self::$editor_id = $factory->user->create( array( 'role' => 'editor' ) ); 27 29 } 28 30 … … 31 33 wp_delete_post( self::$post_id, true ); 32 34 wp_delete_post( self::$cpt_post_id, true ); 35 self::delete_user( self::$editor_id ); 33 36 34 37 unregister_post_type( 'cpt' ); … … 264 267 protected function grant_write_permission() { 265 268 // Ensure we have write permission. 266 $user = self::factory()->user->create( 267 array( 268 'role' => 'editor', 269 ) 270 ); 271 wp_set_current_user( $user ); 269 wp_set_current_user( self::$editor_id ); 272 270 } 273 271
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)