@@ 581-593 (lines=13) @@ | ||
578 | update_option( 'siteurl', $original_siteurl ); |
|
579 | } |
|
580 | ||
581 | function test_normalize_url_protocol_agnostic_strips_protocol_and_www_for_subdir_subdomain() { |
|
582 | $url = 'https://www.subdomain.myfaketestsite.com/what'; |
|
583 | $url_normalized = Jetpack::normalize_url_protocol_agnostic( $url ); |
|
584 | $this->assertTrue( 'subdomain.myfaketestsite.com/what/' === $url_normalized ); |
|
585 | ||
586 | $url = 'http://subdomain.myfaketestsite.com'; |
|
587 | $url_normalized = Jetpack::normalize_url_protocol_agnostic( $url ); |
|
588 | $this->assertTrue( 'subdomain.myfaketestsite.com/' === $url_normalized ); |
|
589 | ||
590 | $url = 'www.subdomain.myfaketestsite.com'; |
|
591 | $url_normalized = Jetpack::normalize_url_protocol_agnostic( $url ); |
|
592 | $this->assertTrue( 'subdomain.myfaketestsite.com/' === $url_normalized ); |
|
593 | } |
|
594 | ||
595 | function test_normalize_url_protocol_agnostic_strips_protocol_and_www_for_normal_urls() { |
|
596 | $url = 'https://www.myfaketestsite.com'; |
|
@@ 595-607 (lines=13) @@ | ||
592 | $this->assertTrue( 'subdomain.myfaketestsite.com/' === $url_normalized ); |
|
593 | } |
|
594 | ||
595 | function test_normalize_url_protocol_agnostic_strips_protocol_and_www_for_normal_urls() { |
|
596 | $url = 'https://www.myfaketestsite.com'; |
|
597 | $url_normalized = Jetpack::normalize_url_protocol_agnostic( $url ); |
|
598 | $this->assertTrue( 'myfaketestsite.com/' === $url_normalized ); |
|
599 | ||
600 | $url = 'www.myfaketestsite.com'; |
|
601 | $url_normalized = Jetpack::normalize_url_protocol_agnostic( $url ); |
|
602 | $this->assertTrue( 'myfaketestsite.com/' === $url_normalized ); |
|
603 | ||
604 | $url = 'myfaketestsite.com'; |
|
605 | $url_normalized = Jetpack::normalize_url_protocol_agnostic( $url ); |
|
606 | $this->assertTrue( 'myfaketestsite.com/' === $url_normalized ); |
|
607 | } |
|
608 | ||
609 | function test_normalize_url_protocol_agnostic_strips_protocol_for_ip() { |
|
610 | $url = 'http://123.456.789.0'; |