Exemple #1
0
 public function testHttpsProtocolToString()
 {
     $urlParser = new UrlParser('https://*****:*****@mydomain.com:8080/path?name=heudon&last_name=reinaldo#top');
     $parsedUrl = $urlParser->parse();
     $this->assertInstanceOf('Kbca\\UrlParser\\ValueObject\\Protocol', $parsedUrl->getProtocol());
     $this->assertEquals('https', $parsedUrl->getProtocol()->getValue());
     $this->assertEquals('https://', $parsedUrl->getProtocol()->__toString());
 }
Exemple #2
0
 public function testParsedUrlWithDuplicateDot()
 {
     $urlParser = new UrlParser('http://*****:*****@mydomain...com..br:8080/path?name=heudon&last_name=reinaldo#top');
     $parsedUrl = $urlParser->parse();
     $this->assertEquals('http://*****:*****@mydomain.com.br:8080/path?name=heudon&last_name=reinaldo#top', $parsedUrl);
 }
Exemple #3
0
 /**
  * @dataProvider urlsProvider
  */
 public function testToString($url)
 {
     $urlParser = new UrlParser($url);
     $parsedUrl = $urlParser->parse();
     $this->assertEquals('mydomain.com:8080', $parsedUrl->getHost()->__toString());
 }
Exemple #4
0
 /**
  * @dataProvider urlsProvider
  */
 public function testToString($url)
 {
     $urlParser = new UrlParser($url);
     $parsedUrl = $urlParser->parse();
     $this->assertEquals($url, $parsedUrl->__toString());
 }
Exemple #5
0
 /**
  * @dataProvider urlsProvider
  */
 public function testToString($url)
 {
     $urlParser = new UrlParser($url);
     $parsedUrl = $urlParser->parse();
     $this->assertEquals('/path?name=heudon&last_name=reinaldo#top', $parsedUrl->getParam()->__toString());
 }
Exemple #6
0
 /**
  * @dataProvider urlsProviderWithUser
  */
 public function testToString($url)
 {
     $urlParser = new UrlParser($url);
     $parsedUrl = $urlParser->parse();
     $this->assertEquals('heudon:123321@', $parsedUrl->getUser()->__toString());
 }