Esempio n. 1
0
 public function fromString()
 {
     $uri = new Uri('http://*****:*****@europaphp.org:80/documentation?component=Uri#properties');
     $this->assert($uri->getScheme() === 'http', 'Scheme was not parsed properly.');
     $this->assert($uri->getUsername() === 'trey', 'Username was not parsed properly.');
     $this->assert($uri->getPassword() === 'shugart', 'Password was not parsed properly.');
     $this->assert($uri->getHost() === 'europaphp.org', 'Host was not parsed properly.');
     $this->assert($uri->getPort() === 80, 'Port was not parsed properly.');
     $this->assert($uri->getRequest() === 'documentation', 'Request was not parsed properly.');
     $this->assert($uri->getQuery() === 'component=Uri', 'Query was not parsed properly.');
     $this->assert($uri->getFragment() === 'properties', 'Fragment was not parsed properly.');
 }