Пример #1
0
 public function testNormalizedUrlWithoutFragmentId()
 {
     $url = new CUrl("http://www.example.com");
     $this->assertTrue($url->normalizedUrlWithoutFragmentId()->equals("http://www.example.com/"));
     $url = new CUrl("WWW.EXAMPLE.COM");
     $this->assertTrue($url->normalizedUrlWithoutFragmentId()->equals("http://www.example.com/"));
     $url = new CUrl("93.184.216.119");
     $this->assertTrue($url->normalizedUrlWithoutFragmentId()->equals("http://93.184.216.119/"));
     $url = new CUrl("[0:0:0:0:0:FFFF:5DB8:D877]");
     $this->assertTrue($url->normalizedUrlWithoutFragmentId()->equals("http://[0:0:0:0:0:ffff:5db8:d877]/"));
     $url = new CUrl("http://www.example.com:443");
     $this->assertTrue($url->normalizedUrlWithoutFragmentId()->equals("http://www.example.com:443/"));
     $url = new CUrl("http://www.example.com/path/to/some%20ite%6D");
     $this->assertTrue($url->normalizedUrlWithoutFragmentId()->equals("http://www.example.com/path/to/some%20item"));
     $url = new CUrl("http://www.example.com/?name=value");
     $this->assertTrue($url->normalizedUrlWithoutFragmentId()->equals("http://www.example.com/?name=value"));
     $url = new CUrl("http://www.example.com/?name=value0&name=value1");
     $this->assertTrue($url->normalizedUrlWithoutFragmentId()->equals("http://www.example.com/?name=value1"));
     $url = new CUrl("http://www.example.com/?name1&name0=value");
     $this->assertTrue($url->normalizedUrlWithoutFragmentId()->equals("http://www.example.com/?name0=value&name1="));
     $url = new CUrl("http://www.example.com/#fragment_id");
     $this->assertTrue($url->normalizedUrlWithoutFragmentId()->equals("http://www.example.com/"));
     $url = new CUrl("http://user@www.example.com");
     $this->assertTrue($url->normalizedUrlWithoutFragmentId()->equals("http://user@www.example.com/"));
     $url = new CUrl("http://*****:*****@www.example.com");
     $this->assertTrue($url->normalizedUrlWithoutFragmentId()->equals("http://*****:*****@www.example.com/"));
 }