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 1010use Activitypub \Collection \Interactions ;
1111
1212use function Activitypub \is_self_ping ;
13+ use function Activitypub \is_activity_reply ;
1314use function Activitypub \is_activity_public ;
1415use function Activitypub \object_id_to_comment ;
1516
Original file line number Diff line number Diff line change @@ -121,4 +121,25 @@ public function test_handle_create_non_public_rejected() {
121121 $ converted = Create::handle_create ( $ object , $ this ->user_id );
122122 $ this ->assertNull ( $ converted );
123123 }
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+ }
124145}
You can’t perform that action at this time.
0 commit comments