isPortDefault() 공개 메소드

Whether the port is the default for the scheme.
public isPortDefault ( ) : boolean
리턴 boolean
예제 #1
0
파일: UrlTest.php 프로젝트: 99designs/ergo
 public function testIsDefaultPort()
 {
     $defaultPortUrls = array('http://example.org/', 'http://example.org:80/', 'https://example.org/', 'https://example.org:443/');
     $customPortUrls = array('http://example.org:443/', 'https://example.org:80/', 'http://example.org:8080/', 'https://example.org:8090/');
     foreach ($defaultPortUrls as $urlString) {
         $url = new Http\Url($urlString);
         $this->assertTrue($url->isPortDefault(), "port should be default in {$urlString}");
     }
     foreach ($customPortUrls as $urlString) {
         $url = new Http\Url($urlString);
         $this->assertFalse($url->isPortDefault(), "port should not be default in {$urlString}");
     }
 }