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