@@ -993,9 +993,6 @@ public function test_mention_filters_recipients() {
993993 * @covers ::maybe_prevent_comment_notification
994994 */
995995 public function test_prevent_email_notifications_for_ap_post_comments () {
996- // Enable the create_posts option.
997- \update_option ( 'activitypub_create_posts ' , '1 ' );
998-
999996 // Create an ap_post.
1000997 $ ap_post_id = self ::factory ()->post ->create (
1001998 array (
@@ -1019,9 +1016,6 @@ public function test_prevent_email_notifications_for_ap_post_comments() {
10191016 // Test notify_moderator filter.
10201017 $ notify_moderator = \apply_filters ( 'notify_moderator ' , true , $ comment_id );
10211018 $ this ->assertFalse ( $ notify_moderator , 'Email notifications to moderator should be prevented for ap_post comments ' );
1022-
1023- // Clean up.
1024- \delete_option ( 'activitypub_create_posts ' );
10251019 }
10261020
10271021 /**
@@ -1030,9 +1024,6 @@ public function test_prevent_email_notifications_for_ap_post_comments() {
10301024 * @covers ::maybe_prevent_comment_notification
10311025 */
10321026 public function test_allow_email_notifications_for_regular_post_comments () {
1033- // Enable the create_posts option.
1034- \update_option ( 'activitypub_create_posts ' , '1 ' );
1035-
10361027 // Create a regular post.
10371028 $ post_id = self ::factory ()->post ->create (
10381029 array (
@@ -1055,43 +1046,6 @@ public function test_allow_email_notifications_for_regular_post_comments() {
10551046 // Test notify_moderator filter.
10561047 $ notify_moderator = \apply_filters ( 'notify_moderator ' , true , $ comment_id );
10571048 $ this ->assertTrue ( $ notify_moderator , 'Email notifications to moderator should be allowed for regular post comments ' );
1058-
1059- // Clean up.
1060- \delete_option ( 'activitypub_create_posts ' );
1061- }
1062-
1063- /**
1064- * Test that email notifications are allowed for ap_post when option is disabled.
1065- *
1066- * @covers ::maybe_prevent_comment_notification
1067- */
1068- public function test_allow_email_notifications_when_option_disabled () {
1069- // Ensure the create_posts option is disabled.
1070- \delete_option ( 'activitypub_create_posts ' );
1071-
1072- // Create an ap_post.
1073- $ ap_post_id = self ::factory ()->post ->create (
1074- array (
1075- 'post_type ' => 'ap_post ' ,
1076- 'post_status ' => 'publish ' ,
1077- )
1078- );
1079-
1080- // Create a comment on the ap_post.
1081- $ comment_id = self ::factory ()->comment ->create (
1082- array (
1083- 'comment_post_ID ' => $ ap_post_id ,
1084- 'comment_approved ' => '1 ' ,
1085- )
1086- );
1087-
1088- // Test notify_post_author filter.
1089- $ notify_author = \apply_filters ( 'notify_post_author ' , true , $ comment_id );
1090- $ this ->assertTrue ( $ notify_author , 'Email notifications should be allowed when option is disabled ' );
1091-
1092- // Test notify_moderator filter.
1093- $ notify_moderator = \apply_filters ( 'notify_moderator ' , true , $ comment_id );
1094- $ this ->assertTrue ( $ notify_moderator , 'Email notifications should be allowed when option is disabled ' );
10951049 }
10961050
10971051 /**
@@ -1100,9 +1054,6 @@ public function test_allow_email_notifications_when_option_disabled() {
11001054 * @covers ::maybe_prevent_comment_notification
11011055 */
11021056 public function test_respect_existing_notification_settings () {
1103- // Enable the create_posts option.
1104- \update_option ( 'activitypub_create_posts ' , '1 ' );
1105-
11061057 // Create an ap_post.
11071058 $ ap_post_id = self ::factory ()->post ->create (
11081059 array (
@@ -1125,9 +1076,6 @@ public function test_respect_existing_notification_settings() {
11251076
11261077 $ notify_moderator = \apply_filters ( 'notify_moderator ' , false , $ comment_id );
11271078 $ this ->assertFalse ( $ notify_moderator , 'Should respect already disabled notifications ' );
1128-
1129- // Clean up.
1130- \delete_option ( 'activitypub_create_posts ' );
11311079 }
11321080
11331081 /**
0 commit comments