public function testUnset() { $url = new \webignition\Url\Url('http://example.com:8080/'); $this->assertTrue($url->hasPort()); $this->assertEquals(8080, $url->getPort()); $url->setPort(null); $this->assertFalse($url->hasPort()); $this->assertEquals('http://example.com/', (string) $url); }
public function testRelativeUrl() { $url = new \webignition\Url\Url($this->urls['relative']); $this->assertFalse($url->hasScheme()); $this->assertNull($url->getScheme()); $this->assertFalse($url->hasHost()); $this->assertNull($url->getHost()); $this->assertFalse($url->hasPort()); $this->assertNull($url->getPort()); $this->assertFalse($url->hasUser()); $this->assertNull($url->getUser()); $this->assertFalse($url->hasPass()); $this->assertNull($url->getPass()); $this->assertTrue($url->hasPath()); $this->assertEquals($this->completePath(), $url->getPath()); $this->assertTrue($url->hasQuery()); $this->assertEquals($this->completeUrlQueryString(), $url->getQuery()); $this->assertTrue($url->hasFragment()); $this->assertEquals(self::FRAGMENT, $url->getFragment()); $this->assertEquals($this->urls['relative'], (string) $url); }