Code Duplication    Length = 14-19 lines in 2 locations

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

@@ 761-774 (lines=14) @@
758
		Constants::clear_constants();
759
	}
760
761
	function test_get_raw_url_returns_with_http_if_is_ssl() {
762
		$home_option = get_option( 'home' );
763
764
		// Test without https first
765
		$this->assertEquals( $home_option, Functions::get_raw_url( 'home' ) );
766
767
		// Now, with https
768
		$_SERVER['HTTPS'] = 'on';
769
		$this->assertEquals(
770
			set_url_scheme( $home_option, 'http' ),
771
			Functions::get_raw_url( 'home' )
772
		);
773
		unset( $_SERVER['HTTPS'] );
774
	}
775
776
	function test_raw_home_url_is_https_when_is_ssl() {
777
		Constants::set_constant( 'JETPACK_SYNC_USE_RAW_URL', true );
@@ 776-794 (lines=19) @@
773
		unset( $_SERVER['HTTPS'] );
774
	}
775
776
	function test_raw_home_url_is_https_when_is_ssl() {
777
		Constants::set_constant( 'JETPACK_SYNC_USE_RAW_URL', true );
778
779
		$home_option = get_option( 'home' );
780
781
		// Test without https first
782
		$this->assertEquals(
783
			$home_option,
784
			Functions::home_url()
785
		);
786
787
		// Now, with https
788
		$_SERVER['HTTPS'] = 'on';
789
		$this->assertEquals(
790
			set_url_scheme( $home_option, 'https' ),
791
			Functions::home_url()
792
		);
793
		unset( $_SERVER['HTTPS'] );
794
	}
795
796
	function test_user_can_stop_raw_urls() {
797
		add_filter( 'option_home', array( $this, 'return_filtered_url' ) );