Exemplo n.º 1
0
Arquivo: UrlTest.php Projeto: 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());
 }