Exemplo n.º 1
0
 public function testGetUserInfo()
 {
     // If no user information is present, this method MUST return an empty
     // string.
     $uri = new Uri('/abc/def');
     $this->assertSame('', $uri->getUserInfo());
     // If a user is present in the URI, this will return that value;
     // additionally, if the password is also present, it will be appended to the
     // user value, with a colon (":") separating the values.
     // The trailing "@" character is not part of the user information and MUST
     // NOT be added.
     $uri = new Uri('http://wan2land@blog.wani.kr');
     $this->assertSame('wan2land', $uri->getUserInfo());
     $uri = new Uri('http://*****:*****@blog.wani.kr');
     $this->assertSame('wan2land:hello', $uri->getUserInfo());
 }