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