File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 10
10
use Activitypub \Collection \Interactions ;
11
11
12
12
use function Activitypub \is_self_ping ;
13
+ use function Activitypub \is_activity_reply ;
13
14
use function Activitypub \is_activity_public ;
14
15
use function Activitypub \object_id_to_comment ;
15
16
Original file line number Diff line number Diff line change @@ -121,4 +121,25 @@ public function test_handle_create_non_public_rejected() {
121
121
$ converted = Create::handle_create ( $ object , $ this ->user_id );
122
122
$ this ->assertNull ( $ converted );
123
123
}
124
+
125
+ /**
126
+ * Test handle create.
127
+ *
128
+ * @covers ::handle_create
129
+ */
130
+ public function test_handle_create_public_accepted () {
131
+ $ object = $ this ->create_test_object ();
132
+ Create::handle_create ( $ object , $ this ->user_id );
133
+
134
+ $ args = array (
135
+ 'type ' => 'comment ' ,
136
+ 'post_id ' => $ this ->post_id ,
137
+ );
138
+
139
+ $ query = new \WP_Comment_Query ( $ args );
140
+ $ result = $ query ->comments ;
141
+
142
+ $ this ->assertInstanceOf ( 'WP_Comment ' , $ result [0 ] );
143
+ $ this ->assertEquals ( 'example ' , $ result [0 ]->comment_content );
144
+ }
124
145
}
You can’t perform that action at this time.
0 commit comments