Code Duplication    Length = 14-19 lines in 2 locations

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

@@ 783-796 (lines=14) @@
780
		Constants::clear_constants();
781
	}
782
783
	function test_get_raw_url_returns_with_http_if_is_ssl() {
784
		$home_option = get_option( 'home' );
785
786
		// Test without https first
787
		$this->assertEquals( $home_option, Functions::get_raw_url( 'home' ) );
788
789
		// Now, with https
790
		$_SERVER['HTTPS'] = 'on';
791
		$this->assertEquals(
792
			set_url_scheme( $home_option, 'http' ),
793
			Functions::get_raw_url( 'home' )
794
		);
795
		unset( $_SERVER['HTTPS'] );
796
	}
797
798
	function test_raw_home_url_is_https_when_is_ssl() {
799
		Constants::set_constant( 'JETPACK_SYNC_USE_RAW_URL', true );
@@ 798-816 (lines=19) @@
795
		unset( $_SERVER['HTTPS'] );
796
	}
797
798
	function test_raw_home_url_is_https_when_is_ssl() {
799
		Constants::set_constant( 'JETPACK_SYNC_USE_RAW_URL', true );
800
801
		$home_option = get_option( 'home' );
802
803
		// Test without https first
804
		$this->assertEquals(
805
			$home_option,
806
			Functions::home_url()
807
		);
808
809
		// Now, with https
810
		$_SERVER['HTTPS'] = 'on';
811
		$this->assertEquals(
812
			set_url_scheme( $home_option, 'https' ),
813
			Functions::home_url()
814
		);
815
		unset( $_SERVER['HTTPS'] );
816
	}
817
818
	function test_user_can_stop_raw_urls() {
819
		add_filter( 'option_home', array( $this, 'return_filtered_url' ) );