Exemplo n.º 1
0
 public function testBasicSetHost()
 {
     $value = uniqid('test:');
     $url = new Url();
     $url->setHost($value);
     $this->assertEquals($value, $url->getHost());
 }
Exemplo n.º 2
0
 /**
  * @test
  */
 public function parse_urlIPWithoutProtocol()
 {
     $aUrlComponents = array('scheme' => 'http', 'host' => '127.0.0.1', 'user' => '', 'pass' => '', 'path' => '/', 'query' => [], 'fragment' => '');
     $oUrl = new Url();
     $oUrl->setScheme($aUrlComponents['scheme']);
     $oUrl->setHost($aUrlComponents['host']);
     $oUrl->setPath($aUrlComponents['path']);
     $oUrl->setQuery($aUrlComponents['query']);
     $oUrl->setFragment($aUrlComponents['fragment']);
     $this->assertEquals($oUrl, UrlParserA_underTest::parse_url('//127.0.0.1/'));
 }
Exemplo n.º 3
0
 public function changeSubdomain($sNewSubdomain)
 {
     $this->oUrl->setHost(str_ireplace($this->getSubdomain(), $sNewSubdomain, $this->oUrl->getHost()));
     return $this->oUrl->getHost();
 }
Exemplo n.º 4
0
 public function testIsRemoteIP()
 {
     $oUrl = new Url();
     $oUrl->setHost('8.8.8.8');
     $this->assertFalse($oUrl->isLocal());
 }