public function testGetAuthorityReturnsCorrectPort() { // HTTPS non-standard port $uri = new Uri('https://foo.co:99'); $this->assertEquals('foo.co:99', $uri->getAuthority()); // HTTP non-standard port $uri = new Uri('http://foo.co:99'); $this->assertEquals('foo.co:99', $uri->getAuthority()); // No scheme $uri = new Uri('foo.co:99'); $this->assertEquals('foo.co:99', $uri->getAuthority()); // No host or port $uri = new Uri('http:'); $this->assertEquals('', $uri->getAuthority()); // No host or port $uri = new Uri('http://foo.co'); $this->assertEquals('foo.co', $uri->getAuthority()); }
public function testDefaultReturnValuesOfGetters() { $uri = new Uri(); $this->assertSame('', $uri->getScheme()); $this->assertSame('', $uri->getAuthority()); $this->assertSame('', $uri->getUserInfo()); $this->assertSame('', $uri->getHost()); $this->assertNull($uri->getPort()); $this->assertSame('', $uri->getPath()); $this->assertSame('', $uri->getQuery()); $this->assertSame('', $uri->getFragment()); }