Code Duplication    Length = 23-23 lines in 2 locations

projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-full-immediately.php 1 location

@@ 665-687 (lines=23) @@
662
		$this->assertEqualsObject( $terms, $this->server_replica_storage->get_the_terms( $post_id, 'post_tag' ), 'Full sync doesn\'t work' );
663
	}
664
665
	function test_full_sync_sends_all_comment_meta() {
666
		$post_id     = $this->factory->post->create();
667
		$comment_ids = $this->factory->comment->create_post_comments( $post_id );
668
		$comment_id  = $comment_ids[0];
669
670
		Settings::update_settings( array( 'comment_meta_whitelist' => array( 'test_meta_key' ) ) );
671
672
		add_comment_meta( $comment_id, 'test_meta_key', 'foo' );
673
674
		$this->sender->do_sync();
675
676
		$this->assertEquals( 'foo', $this->server_replica_storage->get_metadata( 'comment', $comment_id, 'test_meta_key', true ) );
677
678
		// reset the storage, check value, and do full sync - storage should be set!
679
		$this->server_replica_storage->reset();
680
681
		$this->assertEquals( null, $this->server_replica_storage->get_metadata( 'comment', $comment_id, 'test_meta_key', true ) );
682
683
		$this->full_sync->start();
684
		$this->sender->do_full_sync();
685
686
		$this->assertEquals( 'foo', $this->server_replica_storage->get_metadata( 'comment', $comment_id, 'test_meta_key', true ) );
687
	}
688
689
	function test_full_sync_sends_theme_info() {
690
		// make sure we don't already use this theme

projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-full.php 1 location

@@ 833-855 (lines=23) @@
830
		$this->assertEqualsObject( $terms, $this->server_replica_storage->get_the_terms( $post_id, 'post_tag' ), 'Full sync doesn\'t work' );
831
	}
832
833
	function test_full_sync_sends_all_comment_meta() {
834
		$post_id     = $this->factory->post->create();
835
		$comment_ids = $this->factory->comment->create_post_comments( $post_id );
836
		$comment_id  = $comment_ids[0];
837
838
		Settings::update_settings( array( 'comment_meta_whitelist' => array( 'test_meta_key' ) ) );
839
840
		add_comment_meta( $comment_id, 'test_meta_key', 'foo' );
841
842
		$this->sender->do_sync();
843
844
		$this->assertEquals( 'foo', $this->server_replica_storage->get_metadata( 'comment', $comment_id, 'test_meta_key', true ) );
845
846
		// reset the storage, check value, and do full sync - storage should be set!
847
		$this->server_replica_storage->reset();
848
849
		$this->assertEquals( null, $this->server_replica_storage->get_metadata( 'comment', $comment_id, 'test_meta_key', true ) );
850
851
		$this->full_sync->start();
852
		$this->sender->do_full_sync();
853
854
		$this->assertEquals( 'foo', $this->server_replica_storage->get_metadata( 'comment', $comment_id, 'test_meta_key', true ) );
855
	}
856
857
	function test_full_sync_sends_theme_info() {
858
		// make sure we don't already use this theme