getUsername() public method

Returns the username of a login
public getUsername ( ) : string
return string User name of the login
コード例 #1
0
 /**
  * Checks if a complete URI with all parts is transformed into an object correctly.
  *
  * @test
  */
 public function constructorParsesAFullBlownUriStringCorrectly()
 {
     $uriString = 'http://*****:*****@subdomain.domain.com:8080/path1/path2/index.php?argument1=value1&argument2=value2&argument3[subargument1]=subvalue1#anchor';
     $uri = new Uri($uriString);
     $check = $uri->getScheme() == 'http' && $uri->getUsername() == 'username' && $uri->getPassword() == 'password' && $uri->getHost() == 'subdomain.domain.com' && $uri->getPort() === 8080 && $uri->getPath() == '/path1/path2/index.php' && $uri->getQuery() == 'argument1=value1&argument2=value2&argument3[subargument1]=subvalue1' && $uri->getArguments() == ['argument1' => 'value1', 'argument2' => 'value2', 'argument3' => ['subargument1' => 'subvalue1']] && $uri->getFragment() == 'anchor';
     $this->assertTrue($check, 'The valid and complete URI has not been correctly transformed to an URI object');
 }