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()); }
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); }
/** * @dataProvider urlsProvider */ public function testToString($url) { $urlParser = new UrlParser($url); $parsedUrl = $urlParser->parse(); $this->assertEquals('mydomain.com:8080', $parsedUrl->getHost()->__toString()); }
/** * @dataProvider urlsProvider */ public function testToString($url) { $urlParser = new UrlParser($url); $parsedUrl = $urlParser->parse(); $this->assertEquals($url, $parsedUrl->__toString()); }
/** * @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()); }
/** * @dataProvider urlsProviderWithUser */ public function testToString($url) { $urlParser = new UrlParser($url); $parsedUrl = $urlParser->parse(); $this->assertEquals('heudon:123321@', $parsedUrl->getUser()->__toString()); }