Skip to content

Commit d398eeb

Browse files
authored
upgrade failing test
1 parent f8e9ddb commit d398eeb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/phpunit/tests/privacy/wpPrivacyResetPolicyPageForPost.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ public function test_deleting_non_page_post_type_does_not_reset_option() {
9696
public function test_notice_self_heals_when_policy_page_does_not_exist() {
9797
update_option( 'wp_page_for_privacy_policy', 99999 );
9898

99-
wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
99+
$user_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
100+
$user = new WP_User( $user_id );
101+
$user->add_cap( 'manage_privacy_options' );
102+
wp_set_current_user( $user_id );
100103
set_current_screen( 'post' );
101104

102105
$post = self::factory()->post->create_and_get( array( 'post_type' => 'page' ) );

0 commit comments

Comments
 (0)