@@ 1003-1022 (lines=20) @@ | ||
1000 | $this->assertEquals( array( $sync_post_id, $sync_post_id_2 ), $sync_status['config']['posts'] ); |
|
1001 | } |
|
1002 | ||
1003 | function test_full_sync_can_sync_individual_comments() { |
|
1004 | $post_id = $this->factory->post->create(); |
|
1005 | list( $sync_comment_id, $no_sync_comment_id, $sync_comment_id_2 ) = $this->factory->comment->create_post_comments( $post_id, 3 ); |
|
1006 | ||
1007 | $this->full_sync->start( array( 'comments' => array( $sync_comment_id, $sync_comment_id_2 ) ) ); |
|
1008 | $this->sender->do_full_sync(); |
|
1009 | ||
1010 | $synced_comments_event = $this->server_event_storage->get_most_recent_event( 'jetpack_full_sync_comments' ); |
|
1011 | ||
1012 | $comments = $synced_comments_event->args[0]; |
|
1013 | ||
1014 | $this->assertEquals( 2, count( $comments ) ); |
|
1015 | $comment_IDs = array( $comments[0]->comment_ID, $comments[1]->comment_ID ); |
|
1016 | ||
1017 | $this->assertContains( $sync_comment_id, $comment_IDs ); |
|
1018 | $this->assertContains( $sync_comment_id_2, $comment_IDs ); |
|
1019 | ||
1020 | $sync_status = $this->full_sync->get_status(); |
|
1021 | $this->assertEquals( array( $sync_comment_id, $sync_comment_id_2 ), $sync_status['config']['comments'] ); |
|
1022 | } |
|
1023 | ||
1024 | function test_full_sync_can_sync_individual_users() { |
|
1025 | $sync_user_id = $this->factory->user->create(); |
@@ 1253-1272 (lines=20) @@ | ||
1250 | $this->assertEquals( array( $sync_post_id, $sync_post_id_2 ), $sync_status['config']['posts'] ); |
|
1251 | } |
|
1252 | ||
1253 | function test_full_sync_can_sync_individual_comments() { |
|
1254 | $post_id = $this->factory->post->create(); |
|
1255 | list( $sync_comment_id, $no_sync_comment_id, $sync_comment_id_2 ) = $this->factory->comment->create_post_comments( $post_id, 3 ); |
|
1256 | ||
1257 | $this->full_sync->start( array( 'comments' => array( $sync_comment_id, $sync_comment_id_2 ) ) ); |
|
1258 | $this->sender->do_full_sync(); |
|
1259 | ||
1260 | $synced_comments_event = $this->server_event_storage->get_most_recent_event( 'jetpack_full_sync_comments' ); |
|
1261 | ||
1262 | $comments = $synced_comments_event->args[0]; |
|
1263 | ||
1264 | $this->assertEquals( 2, count( $comments ) ); |
|
1265 | $comment_IDs = array( $comments[0]->comment_ID, $comments[1]->comment_ID ); |
|
1266 | ||
1267 | $this->assertContains( $sync_comment_id, $comment_IDs ); |
|
1268 | $this->assertContains( $sync_comment_id_2, $comment_IDs ); |
|
1269 | ||
1270 | $sync_status = $this->full_sync->get_status(); |
|
1271 | $this->assertEquals( array( $sync_comment_id, $sync_comment_id_2 ), $sync_status['config']['comments'] ); |
|
1272 | } |
|
1273 | ||
1274 | function test_full_sync_can_sync_individual_users() { |
|
1275 | $sync_user_id = $this->factory->user->create(); |