Ejemplo n.º 1
0
 /**
  * @test
  */
 public function removeProtocol()
 {
     //non http
     $this->assertEquals('www.exemplo.com.br', Str::removeProtocol('//www.exemplo.com.br'));
     $this->assertEquals('www.exemplo.com.br', Str::removeProtocol('//www.exemplo.com.br/'));
     $this->assertEquals('www.exemplo.com.br/teste', Str::removeProtocol('//www.exemplo.com.br/teste'));
     $this->assertEquals('exemplo.com.br', Str::removeProtocol('//exemplo.com.br'));
     $this->assertEquals('exemplo.com.br', Str::removeProtocol('//exemplo.com.br/'));
     $this->assertEquals('exemplo.com.br/teste', Str::removeProtocol('//exemplo.com.br/teste'));
     //http
     $this->assertEquals('www.exemplo.com.br', Str::removeProtocol('http://www.exemplo.com.br'));
     $this->assertEquals('www.exemplo.com.br', Str::removeProtocol('http://www.exemplo.com.br/'));
     $this->assertEquals('www.exemplo.com.br/teste', Str::removeProtocol('http://www.exemplo.com.br/teste'));
     $this->assertEquals('exemplo.com.br', Str::removeProtocol('http://exemplo.com.br'));
     $this->assertEquals('exemplo.com.br', Str::removeProtocol('http://exemplo.com.br/'));
     $this->assertEquals('exemplo.com.br/teste', Str::removeProtocol('http://exemplo.com.br/teste'));
     //https
     $this->assertEquals('www.exemplo.com.br', Str::removeProtocol('https://www.exemplo.com.br'));
     $this->assertEquals('www.exemplo.com.br', Str::removeProtocol('https://www.exemplo.com.br/'));
     $this->assertEquals('www.exemplo.com.br/teste', Str::removeProtocol('https://www.exemplo.com.br/teste'));
     $this->assertEquals('exemplo.com.br', Str::removeProtocol('https://exemplo.com.br'));
     $this->assertEquals('exemplo.com.br', Str::removeProtocol('https://exemplo.com.br/'));
     $this->assertEquals('exemplo.com.br/testes', Str::removeProtocol('https://exemplo.com.br/testes'));
 }
Ejemplo n.º 2
0
 /**
  * Remove protocol of URL.
  *
  * @param string $url
  *
  * @return string
  */
 function str_remove_protocol($url)
 {
     return Str::removeProtocol($url);
 }