Code Duplication    Length = 12-13 lines in 2 locations

projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-callables.php 2 locations

@@ 634-646 (lines=13) @@
631
		$this->assertEquals( $sanitized->rest_controller_class, 'WP_REST_Terms_Controller' );
632
	}
633
634
	function test_sanitize_sync_post_type_method_default() {
635
		$label = 'foo_default';
636
		$post_type_object = new WP_Post_Type( $label );
637
		$post_type_object->add_supports();
638
		$post_type_object->add_rewrite_rules();
639
		$post_type_object->register_meta_boxes();
640
		$post_type_object->add_hooks();
641
		$post_type_object->register_taxonomies();
642
643
		$sanitized = Functions::sanitize_post_type( $post_type_object );
644
		$this->assert_sanitized_post_type_default( $sanitized, $label );
645
646
	}
647
648
	function test_sanitize_sync_post_type_method_remove_unknown_values_set() {
649
		$label = 'foo_strange';
@@ 648-659 (lines=12) @@
645
646
	}
647
648
	function test_sanitize_sync_post_type_method_remove_unknown_values_set() {
649
		$label = 'foo_strange';
650
		$post_type_object = new WP_Post_Type( $label, array( 'foo' => 'bar' ) );
651
		$post_type_object->add_supports();
652
		$post_type_object->add_rewrite_rules();
653
		$post_type_object->register_meta_boxes();
654
		$post_type_object->add_hooks();
655
		$post_type_object->register_taxonomies();
656
657
		$sanitized = Functions::sanitize_post_type( $post_type_object );
658
		$this->assert_sanitized_post_type_default( $sanitized, $label );
659
	}
660
661
	function assert_sanitized_post_type_default( $sanitized, $label ) {
662
		$this->assertEquals( $label, $sanitized->name );