public function testGetPort() { // If a port is present, and it is non-standard for the current scheme, // this method MUST return it as an integer. $uri = new Uri('http://blog.wani.kr:8080'); $this->assertSame(8080, $uri->getPort()); // If the port is the standard port used with the current scheme, // this method SHOULD return null. $uri = new Uri('http://blog.wani.kr:80'); $this->assertnull($uri->getPort()); // If no port is present, and no scheme is present, this method MUST return // a null value. $uri = new Uri('/hello/world'); $this->assertNull($uri->getPort()); // If no port is present, but a scheme is present, // this method MAY return the standard port for that scheme, but SHOULD return null. $uri = new Uri('http://blog.wani.kr'); $this->assertNull($uri->getPort()); }