示例#1
0
文件: UrlTest.php 项目: weew/url
 public function test_get_and_set_segments()
 {
     $url = new Url();
     $url->setFragment(1);
     $this->assertEquals(1, $url->getFragment());
     $url->setHost(2);
     $this->assertEquals(2, $url->getHost());
     $url->setPassword(3);
     $this->assertEquals(3, $url->getPassword());
     $url->setPath(4);
     $this->assertEquals('/4', $url->getPath());
     $url->setPort(5);
     $this->assertEquals(5, $url->getPort());
     $url->setQuery(new UrlQuery(['foo' => 'bar']));
     $this->assertEquals('bar', $url->getQuery()->get('foo'));
     $url->setProtocol(7);
     $this->assertEquals(7, $url->getProtocol());
     $url->setUsername(8);
     $this->assertEquals(8, $url->getUsername());
 }