- Timestamp:
- 03/04/2026 08:04:35 PM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-autosaves-controller.php
r61722 r61828 571 571 572 572 public function test_rest_autosave_draft_post_same_author() { 573 $original_option = get_option( 'wp_enable_real_time_collaboration' ); 574 update_option( 'wp_enable_real_time_collaboration', false ); 573 add_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_true' ); 575 574 576 575 wp_set_current_user( self::$editor_id ); … … 608 607 609 608 wp_delete_post( $post_id ); 610 update_option( 'wp_enable_real_time_collaboration', $original_option);609 remove_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_true' ); 611 610 } 612 611 … … 749 748 750 749 public function test_update_item_draft_page_with_parent() { 751 $original_option = get_option( 'wp_enable_real_time_collaboration' ); 752 update_option( 'wp_enable_real_time_collaboration', false ); 750 add_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_true' ); 753 751 754 752 wp_set_current_user( self::$editor_id ); … … 769 767 $this->assertSame( self::$child_draft_page_id, $data['id'] ); 770 768 $this->assertSame( self::$parent_page_id, $data['parent'] ); 771 update_option( 'wp_enable_real_time_collaboration', $original_option ); 769 770 remove_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_true' ); 772 771 } 773 772 … … 935 934 */ 936 935 public function test_rest_autosave_draft_post_same_author_with_rtc() { 937 $original_option = get_option( 'wp_enable_real_time_collaboration' ); 938 update_option( 'wp_enable_real_time_collaboration', true ); 936 add_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_false' ); 939 937 940 938 wp_set_current_user( self::$editor_id ); … … 975 973 976 974 wp_delete_post( $post_id ); 977 update_option( 'wp_enable_real_time_collaboration', $original_option);975 remove_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_false' ); 978 976 } 979 977 … … 983 981 */ 984 982 public function test_update_item_draft_page_with_parent_with_rtc() { 985 $original_option = get_option( 'wp_enable_real_time_collaboration' ); 986 update_option( 'wp_enable_real_time_collaboration', true ); 983 add_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_false' ); 987 984 988 985 wp_set_current_user( self::$editor_id ); … … 1004 1001 $this->assertNotSame( self::$child_draft_page_id, $data['id'] ); 1005 1002 $this->assertSame( self::$child_draft_page_id, $data['parent'] ); 1006 update_option( 'wp_enable_real_time_collaboration', $original_option ); 1003 1004 remove_filter( 'pre_option_wp_disable_real_time_collaboration', '__return_false' ); 1007 1005 } 1008 1006 }
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)