Changeset 62058 for trunk/tests/phpunit/tests/rest-api/rest-sync-server.php
- Timestamp:
- 03/19/2026 07:35:44 AM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-sync-server.php
r61865 r62058 18 18 self::$subscriber_id = $factory->user->create( array( 'role' => 'subscriber' ) ); 19 19 self::$post_id = $factory->post->create( array( 'post_author' => self::$editor_id ) ); 20 21 // Enable option in setUpBeforeClass to ensure REST routes are registered. 22 update_option( 'wp_collaboration_enabled', 1 ); 20 23 } 21 24 … … 23 26 self::delete_user( self::$editor_id ); 24 27 self::delete_user( self::$subscriber_id ); 28 delete_option( 'wp_collaboration_enabled' ); 25 29 wp_delete_post( self::$post_id, true ); 26 30 } … … 30 34 31 35 // Enable option for tests. 32 add_filter( 'pre_option_wp_enable_real_time_collaboration', '__return_true');36 update_option( 'wp_collaboration_enabled', 1 ); 33 37 34 38 // Reset storage post ID cache to ensure clean state after transaction rollback. … … 109 113 global $wp_rest_server; 110 114 111 // Remove the pre_option filter added in ::set_up() so get_option() uses its default logic.112 remove_filter( 'pre_option_wp_enable_real_time_collaboration', '__return_true' );113 114 115 // Ensure the option is not in the database. 115 delete_option( 'wp_ enable_real_time_collaboration' );116 delete_option( 'wp_collaboration_enabled' ); 116 117 117 118 // Reset the REST server so routes are re-registered from scratch. … … 119 120 120 121 $routes = rest_get_server()->get_routes(); 121 $this->assertArray HasKey( '/wp-sync/v1/updates', $routes );122 $this->assertArrayNotHasKey( '/wp-sync/v1/updates', $routes ); 122 123 } 123 124
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)